ctr contents ls sorts the labels of the content

Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
Iceber Gu 2022-12-30 15:58:44 +08:00
parent 66f186d42d
commit 6b333fd210

View File

@ -21,6 +21,7 @@ import (
"fmt"
"io"
"os"
"sort"
"strings"
"text/tabwriter"
"time"
@ -211,6 +212,7 @@ var (
for k, v := range info.Labels {
labelStrings = append(labelStrings, strings.Join([]string{k, v}, "="))
}
sort.Strings(labelStrings)
labels := strings.Join(labelStrings, ",")
if labels == "" {
labels = "-"