Fix kubectl describe output format for empty annotations

This commit is contained in:
Yashpal Choudhary 2020-05-25 14:03:20 +05:30
parent 1d365a8cad
commit 73a43f35f5

View File

@ -4716,11 +4716,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 {
@ -4729,7 +4724,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
}