Skip to content

Commit 73a43f3

Browse files
committed
Fix kubectl describe output format for empty annotations
1 parent 1d365a8 commit 73a43f3

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
@@ -4716,11 +4716,6 @@ var maxAnnotationLen = 140
47164716
func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[string]string) {
47174717
w.Write(LEVEL_0, "%s:\t", title)
47184718

4719-
if len(annotations) == 0 {
4720-
w.WriteLine("<none>")
4721-
return
4722-
}
4723-
47244719
// to print labels in the sorted order
47254720
keys := make([]string, 0, len(annotations))
47264721
for key := range annotations {
@@ -4729,7 +4724,7 @@ func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[str
47294724
}
47304725
keys = append(keys, key)
47314726
}
4732-
if len(annotations) == 0 {
4727+
if len(keys) == 0 {
47334728
w.WriteLine("<none>")
47344729
return
47354730
}

0 commit comments

Comments
 (0)