From 768978883d84334367fc50671fcca383b804c22b Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Tue, 1 Aug 2023 09:55:39 -0400 Subject: [PATCH] cli: search all namespaces for node volumes (#17925) When looking for CSI volumes to display in the `node status` command the CLI needs to search all namespaces. --- .changelog/17925.txt | 3 +++ command/node_status.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changelog/17925.txt diff --git a/.changelog/17925.txt b/.changelog/17925.txt new file mode 100644 index 000000000000..22ca9ef28342 --- /dev/null +++ b/.changelog/17925.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed a bug that prevented CSI volumes in namespaces other than `default` from being displayed in the `nomad node status -verbose` output +``` diff --git a/command/node_status.go b/command/node_status.go index 46bd41384c01..ee7b237bc31c 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -687,7 +687,9 @@ func (c *NodeStatusCommand) outputNodeCSIVolumeInfo(client *api.Client, node *ap // Fetch the volume objects with current status // Ignore an error, all we're going to do is omit the volumes volumes := map[string]*api.CSIVolumeListStub{} - vs, _ := client.Nodes().CSIVolumes(node.ID, nil) + vs, _ := client.Nodes().CSIVolumes(node.ID, &api.QueryOptions{ + Namespace: "*", + }) for _, v := range vs { n, ok := requests[v.ID] if ok {