Skip to content

Commit 1846070

Browse files
Merge pull request #10819 from ashley-cui/connls
[NO TESTS NEEDED] Make system connection ls deterministic
2 parents 793063e + 3e8c0e0 commit 1846070

File tree

1 file changed

+5
-0
lines changed
  • cmd/podman/system/connection

1 file changed

+5
-0
lines changed

cmd/podman/system/connection/list.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package connection
33
import (
44
"fmt"
55
"os"
6+
"sort"
67

78
"github.com/containers/common/pkg/completion"
89
"github.com/containers/common/pkg/config"
@@ -77,6 +78,10 @@ func list(cmd *cobra.Command, _ []string) error {
7778
rows = append(rows, r)
7879
}
7980

81+
sort.Slice(rows, func(i, j int) bool {
82+
return rows[i].Name < rows[j].Name
83+
})
84+
8085
format := "{{.Name}}\t{{.Identity}}\t{{.URI}}\n"
8186
switch {
8287
case report.IsJSON(cmd.Flag("format").Value.String()):

0 commit comments

Comments
 (0)