ctr contents ls
sorts the labels of the content
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
parent
66f186d42d
commit
6b333fd210
@ -21,6 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
@ -211,6 +212,7 @@ var (
|
|||||||
for k, v := range info.Labels {
|
for k, v := range info.Labels {
|
||||||
labelStrings = append(labelStrings, strings.Join([]string{k, v}, "="))
|
labelStrings = append(labelStrings, strings.Join([]string{k, v}, "="))
|
||||||
}
|
}
|
||||||
|
sort.Strings(labelStrings)
|
||||||
labels := strings.Join(labelStrings, ",")
|
labels := strings.Join(labelStrings, ",")
|
||||||
if labels == "" {
|
if labels == "" {
|
||||||
labels = "-"
|
labels = "-"
|
||||||
|
Loading…
Reference in New Issue
Block a user