mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
sort token usages in kubeadm
This commit is contained in:
parent
fbe2d15f8c
commit
37bc44f66b
@ -20,6 +20,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
@ -287,6 +288,7 @@ func RunListTokens(out io.Writer, errW io.Writer, client *clientset.Clientset) e
|
|||||||
}
|
}
|
||||||
usages = append(usages, strings.TrimPrefix(k, bootstrapapi.BootstrapTokenUsagePrefix))
|
usages = append(usages, strings.TrimPrefix(k, bootstrapapi.BootstrapTokenUsagePrefix))
|
||||||
}
|
}
|
||||||
|
sort.Strings(usages)
|
||||||
usageString := strings.Join(usages, ",")
|
usageString := strings.Join(usages, ",")
|
||||||
if len(usageString) == 0 {
|
if len(usageString) == 0 {
|
||||||
usageString = "<none>"
|
usageString = "<none>"
|
||||||
|
Loading…
Reference in New Issue
Block a user