diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe.go b/staging/src/k8s.io/kubectl/pkg/describe/describe.go index 876e66ff975..d8357fecf20 100644 --- a/staging/src/k8s.io/kubectl/pkg/describe/describe.go +++ b/staging/src/k8s.io/kubectl/pkg/describe/describe.go @@ -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("") - 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("") return }