Skip to content

Commit d49d045

Browse files
authored
Merge pull request kubernetes#91405 from iyashu/fix/kubectl-describe-empty-annotations
Fix kubectl describe output format for empty annotations
2 parents 0e93436 + 73a43f3 commit d49d045

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

staging/src/k8s.io/kubectl/pkg/describe/describe.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4719,11 +4719,6 @@ var maxAnnotationLen = 140
47194719
func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[string]string) {
47204720
w.Write(LEVEL_0, "%s:\t", title)
47214721

4722-
if len(annotations) == 0 {
4723-
w.WriteLine("<none>")
4724-
return
4725-
}
4726-
47274722
// to print labels in the sorted order
47284723
keys := make([]string, 0, len(annotations))
47294724
for key := range annotations {
@@ -4732,7 +4727,7 @@ func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[str
47324727
}
47334728
keys = append(keys, key)
47344729
}
4735-
if len(annotations) == 0 {
4730+
if len(keys) == 0 {
47364731
w.WriteLine("<none>")
47374732
return
47384733
}

0 commit comments

Comments
 (0)