summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-29 17:07:44 -0400
committerGitHub <noreply@github.com>2021-06-29 17:07:44 -0400
commit1846070f051d36950846787e0045a3ad4724ed66 (patch)
tree442f639be1b9a4f2bfdee05153e59675a803c0a5
parent793063e086d2a7fe15833be5456af95bc9b6ba24 (diff)
parent3e8c0e00de5d29de31005f4932147548f256a194 (diff)
downloadpodman-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
-rw-r--r--cmd/podman/system/connection/list.go5
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()):