mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix kubectl describe output format for empty annotations
This commit is contained in:
parent
1d365a8cad
commit
73a43f35f5
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user