Merge pull request #54628 from deads2k/cli-04-sa-describe

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make printing deterministic

Fixes https://github.com/kubernetes/kubernetes/issues/54619.

Describers should be deterministic.  This fixes the code so that it prints consistently for a given object.
pull/6/head
Kubernetes Submit Queue 2017-10-26 08:28:38 -07:00 committed by GitHub
commit 1f53329c67
1 changed files with 2 additions and 1 deletions

View File

@ -2273,7 +2273,8 @@ func describeServiceAccount(serviceAccount *api.ServiceAccount, tokens []api.Sec
mountHeader: mountSecretNames,
tokenHeader: tokenSecretNames,
}
for header, names := range types {
for _, header := range sets.StringKeySet(types).List() {
names := types[header]
if len(names) == 0 {
w.Write(LEVEL_0, "%s\t<none>\n", header)
} else {