Merge pull request #7881 from Iceber/sort_content_labels

This commit is contained in:
Fu Wei 2022-12-31 11:30:32 +08:00 committed by GitHub
commit 426175e517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = "-"