From ab4950b6849d67fb0900de12d34d0e27e0312d3f Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 26 Feb 2020 21:24:31 -0500 Subject: [PATCH 1/2] api: fix panic when displaying devices w/o stat "" mathces `node status -verbose` output --- api/nodes.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/nodes.go b/api/nodes.go index 4a264eb4d330..6a5adf977c05 100644 --- a/api/nodes.go +++ b/api/nodes.go @@ -676,6 +676,8 @@ type StatValue struct { func (v *StatValue) String() string { switch { + case v == nil: + return "" case v.BoolVal != nil: return strconv.FormatBool(*v.BoolVal) case v.StringVal != nil: From f359bfe85323f0870bdfd7c1e475675fc77f816b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 28 Feb 2020 13:40:51 -0800 Subject: [PATCH 2/2] docs: mention #7231 in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7814a2cd0254..7be81bad3535 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ IMPROVEMENTS: BUG FIXES: * api: Fixed a panic when canonicalizing a jobspec with an incorrect job type [[GH-7207]](https://github.com/hashicorp/nomad/pull/7207) + * cli: Fixed a panic when displaying device plugins without stats [[GH-7231](https://github.com/hashicorp/nomad/issues/7231)] ## 0.10.4 (February 19, 2020)