Merge pull request #91405 from iyashu/fix/kubectl-describe-empty-annotations

Fix kubectl describe output format for empty annotations
This commit is contained in:
Kubernetes Prow Robot 2020-06-09 10:31:20 -07:00 committed by GitHub
commit d49d045a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4719,11 +4719,6 @@ var maxAnnotationLen = 140
func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[string]string) {
w.Write(LEVEL_0, "%s:\t", title)
if len(annotations) == 0 {
w.WriteLine("<none>")
return
}
// to print labels in the sorted order
keys := make([]string, 0, len(annotations))
for key := range annotations {
@ -4732,7 +4727,7 @@ func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[str
}
keys = append(keys, key)
}
if len(annotations) == 0 {
if len(keys) == 0 {
w.WriteLine("<none>")
return
}