diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-29 17:07:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 17:07:44 -0400 |
commit | 1846070f051d36950846787e0045a3ad4724ed66 (patch) | |
tree | 442f639be1b9a4f2bfdee05153e59675a803c0a5 /cmd/podman | |
parent | 793063e086d2a7fe15833be5456af95bc9b6ba24 (diff) | |
parent | 3e8c0e00de5d29de31005f4932147548f256a194 (diff) | |
download | podman-1846070f051d36950846787e0045a3ad4724ed66.tar.gz podman-1846070f051d36950846787e0045a3ad4724ed66.tar.bz2 podman-1846070f051d36950846787e0045a3ad4724ed66.zip |
Merge pull request #10819 from ashley-cui/connls
[NO TESTS NEEDED] Make system connection ls deterministic
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/system/connection/list.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/system/connection/list.go b/cmd/podman/system/connection/list.go index 2f74215c1..de85ce3fa 100644 --- a/cmd/podman/system/connection/list.go +++ b/cmd/podman/system/connection/list.go @@ -3,6 +3,7 @@ package connection import ( "fmt" "os" + "sort" "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/config" @@ -77,6 +78,10 @@ func list(cmd *cobra.Command, _ []string) error { rows = append(rows, r) } + sort.Slice(rows, func(i, j int) bool { + return rows[i].Name < rows[j].Name + }) + format := "{{.Name}}\t{{.Identity}}\t{{.URI}}\n" switch { case report.IsJSON(cmd.Flag("format").Value.String()): |