From 66809615f42016c3206c759902b65eddb640a5b9 Mon Sep 17 00:00:00 2001 From: Nando <89834752+the-nando@users.noreply.github.com> Date: Wed, 19 Jul 2023 22:36:51 +0200 Subject: [PATCH] volume-status : show namespace the volume belongs to (#17911) * volume-status : show namespace the volume belongs to Re-apply changes reverted by 950235df48869e0f3f1dc8950dc430394ababa85 --- command/node_status.go | 5 +++-- command/volume_status_csi.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/command/node_status.go b/command/node_status.go index f1e123900..ee7b237bc 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -702,14 +702,15 @@ func (c *NodeStatusCommand) outputNodeCSIVolumeInfo(client *api.Client, node *ap // Output the volumes in name order output := make([]string, 0, len(names)+1) - output = append(output, "ID|Name|Plugin ID|Schedulable|Provider|Access Mode") + output = append(output, "ID|Name|Namespace|Plugin ID|Schedulable|Provider|Access Mode") for _, name := range names { v, ok := volumes[name] if ok { output = append(output, fmt.Sprintf( - "%s|%s|%s|%t|%s|%s", + "%s|%s|%s|%s|%t|%s|%s", v.ID, name, + v.Namespace, v.PluginID, v.Schedulable, v.Provider, diff --git a/command/volume_status_csi.go b/command/volume_status_csi.go index 5ea83d65d..f6ba7d275 100644 --- a/command/volume_status_csi.go +++ b/command/volume_status_csi.go @@ -187,11 +187,12 @@ func (c *VolumeStatusCommand) csiFormatVolumes(vols []*api.CSIVolumeListStub) (s // Format the volumes, assumes that we're already sorted by volume ID func csiFormatSortedVolumes(vols []*api.CSIVolumeListStub) (string, error) { rows := make([]string, len(vols)+1) - rows[0] = "ID|Name|Plugin ID|Schedulable|Access Mode" + rows[0] = "ID|Name|Namespace|Plugin ID|Schedulable|Access Mode" for i, v := range vols { - rows[i+1] = fmt.Sprintf("%s|%s|%s|%t|%s", + rows[i+1] = fmt.Sprintf("%s|%s|%s|%s|%t|%s", v.ID, v.Name, + v.Namespace, v.PluginID, v.Schedulable, v.AccessMode,