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.
This commit is contained in:
Luiz Aoqui
2023-08-01 09:55:39 -04:00
committed by GitHub
parent 4841791c86
commit 768978883d
2 changed files with 6 additions and 1 deletions

3
.changelog/17925.txt Normal file
View File

@@ -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
```

View File

@@ -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 {