mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +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) {
|
func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[string]string) {
|
||||||
w.Write(LEVEL_0, "%s:\t", title)
|
w.Write(LEVEL_0, "%s:\t", title)
|
||||||
|
|
||||||
if len(annotations) == 0 {
|
|
||||||
w.WriteLine("<none>")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// to print labels in the sorted order
|
// to print labels in the sorted order
|
||||||
keys := make([]string, 0, len(annotations))
|
keys := make([]string, 0, len(annotations))
|
||||||
for key := range annotations {
|
for key := range annotations {
|
||||||
@ -4729,7 +4724,7 @@ func printAnnotationsMultiline(w PrefixWriter, title string, annotations map[str
|
|||||||
}
|
}
|
||||||
keys = append(keys, key)
|
keys = append(keys, key)
|
||||||
}
|
}
|
||||||
if len(annotations) == 0 {
|
if len(keys) == 0 {
|
||||||
w.WriteLine("<none>")
|
w.WriteLine("<none>")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user