diff --git a/.changelog/12154.txt b/.changelog/12154.txt new file mode 100644 index 00000000000..e3e7cbb7fc5 --- /dev/null +++ b/.changelog/12154.txt @@ -0,0 +1,3 @@ +```release-note:improvement +csi: Sort allocations in `plugin status` output +``` diff --git a/command/plugin_status_csi.go b/command/plugin_status_csi.go index a72de5f206a..3ef4d0ee871 100644 --- a/command/plugin_status_csi.go +++ b/command/plugin_status_csi.go @@ -148,7 +148,7 @@ func (c *PluginStatusCommand) formatControllerCaps(controllers map[string]*api.C caps = append(caps, "CREATE_DELETE_SNAPSHOT") fallthrough case info.SupportsListSnapshots: - caps = append(caps, "CREATE_LIST_SNAPSHOTS") + caps = append(caps, "LIST_SNAPSHOTS") fallthrough case info.SupportsClone: caps = append(caps, "CLONE_VOLUME") @@ -177,7 +177,7 @@ func (c *PluginStatusCommand) formatControllerCaps(controllers map[string]*api.C return "" } - return strings.Join(caps, "\n\t") + return " " + strings.Join(sort.StringSlice(caps), "\n ") } func (c *PluginStatusCommand) formatNodeCaps(nodes map[string]*api.CSIInfo) string { @@ -205,5 +205,5 @@ func (c *PluginStatusCommand) formatNodeCaps(nodes map[string]*api.CSIInfo) stri return "" } - return " " + strings.Join(caps, "\n ") + return " " + strings.Join(sort.StringSlice(caps), "\n ") }