improve display format

Kubernetes-commit: 28e7acf0f93f5c9edb43ab09cd181e8847409215
This commit is contained in:
Harald Nordgren 2025-04-27 20:35:38 +02:00 committed by Kubernetes Publisher
parent 7ec7bb7cc1
commit 65d852d39c
2 changed files with 6 additions and 14 deletions

View file

@ -4570,14 +4570,12 @@ func (d *ConfigMapDescriber) Describe(namespace, name string, describerSettings
w.Write(LEVEL_0, "\nData\n====\n")
for _, k := range slices.Sorted(maps.Keys(configMap.Data)) {
v := configMap.Data[k]
w.Write(LEVEL_0, "%s:\n----\n", k)
w.Write(LEVEL_0, "%s\n", string(v))
w.Write(LEVEL_0, "\n")
w.Write(LEVEL_0, "%s:\t%s\n", k, string(v))
}
w.Write(LEVEL_0, "\nBinaryData\n====\n")
for _, k := range slices.Sorted(maps.Keys(configMap.BinaryData)) {
v := configMap.BinaryData[k]
w.Write(LEVEL_0, "%s: %s bytes\n", k, strconv.Itoa(len(v)))
w.Write(LEVEL_0, "%s:\t%s bytes\n", k, strconv.Itoa(len(v)))
}
w.Write(LEVEL_0, "\n")

View file

@ -721,19 +721,13 @@ Annotations: <none>
Data
====
key1:
----
value1
key2:
----
value2
key1: value1
key2: value2
BinaryData
====
binarykey1: 5 bytes
binarykey2: 6 bytes
binarykey1: 5 bytes
binarykey2: 6 bytes
Events: <none>
`