Skip to content

Commit

Permalink
CSI: sort capabilities in plugin status (#12154)
Browse files Browse the repository at this point in the history
Also fix `LIST_SNAPSHOTS` capability name
  • Loading branch information
tgross committed Mar 1, 2022
1 parent 05034a6 commit c06f31e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/12154.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
csi: Sort allocations in `plugin status` output
```
6 changes: 3 additions & 3 deletions command/plugin_status_csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 ")
}

0 comments on commit c06f31e

Please sign in to comment.