mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
Make system connection ls deterministic
Sort system connection ls by name, making the output deterministic. Previously, we were just iterating through a map, which caused CI flakes. Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
@ -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()):
|
||||
|
Reference in New Issue
Block a user