We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e0997d + ec8dfba commit 26858c3Copy full SHA for 26858c3
pkg/commands/volume.go
@@ -36,7 +36,16 @@ func (c *DockerCommand) RefreshVolumes() error {
36
37
ownVolumes := make([]*Volume, len(volumes))
38
39
+ // we're sorting these volumes based on whether they have labels defined,
40
+ // because those are the ones you typically care about.
41
+ // Within that, we also sort them alphabetically
42
sort.Slice(volumes, func(i, j int) bool {
43
+ if len(volumes[i].Labels) == 0 && len(volumes[j].Labels) > 0 {
44
+ return false
45
+ }
46
+ if len(volumes[i].Labels) > 0 && len(volumes[j].Labels) == 0 {
47
+ return true
48
49
return volumes[i].Name < volumes[j].Name
50
})
51
0 commit comments