CSI: sort capabilities in `plugin status` (#12154)
Also fix `LIST_SNAPSHOTS` capability name
This commit is contained in:
parent
ca06f6153a
commit
99d03cdc6c
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
csi: Sort allocations in `plugin status` output
|
||||||
|
```
|
|
@ -148,7 +148,7 @@ func (c *PluginStatusCommand) formatControllerCaps(controllers map[string]*api.C
|
||||||
caps = append(caps, "CREATE_DELETE_SNAPSHOT")
|
caps = append(caps, "CREATE_DELETE_SNAPSHOT")
|
||||||
fallthrough
|
fallthrough
|
||||||
case info.SupportsListSnapshots:
|
case info.SupportsListSnapshots:
|
||||||
caps = append(caps, "CREATE_LIST_SNAPSHOTS")
|
caps = append(caps, "LIST_SNAPSHOTS")
|
||||||
fallthrough
|
fallthrough
|
||||||
case info.SupportsClone:
|
case info.SupportsClone:
|
||||||
caps = append(caps, "CLONE_VOLUME")
|
caps = append(caps, "CLONE_VOLUME")
|
||||||
|
@ -177,7 +177,7 @@ func (c *PluginStatusCommand) formatControllerCaps(controllers map[string]*api.C
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return strings.Join(caps, "\n\t")
|
return " " + strings.Join(sort.StringSlice(caps), "\n ")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PluginStatusCommand) formatNodeCaps(nodes map[string]*api.CSIInfo) string {
|
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 ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return " " + strings.Join(caps, "\n ")
|
return " " + strings.Join(sort.StringSlice(caps), "\n ")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue