From 242e591e5f740ed2cdabff85872a12f7f582caac Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Mon, 28 Feb 2022 16:07:11 -0500 Subject: [PATCH] csi: sort allocations in plugin status --- .changelog/12154.txt | 3 +++ command/plugin_status_csi.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changelog/12154.txt diff --git a/.changelog/12154.txt b/.changelog/12154.txt new file mode 100644 index 000000000000..e3e7cbb7fc54 --- /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 a72de5f206ac..bd1295742a60 100644 --- a/command/plugin_status_csi.go +++ b/command/plugin_status_csi.go @@ -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 ") }