Revert "improve display format"

This reverts commit 28e7acf0f93f5c9edb43ab09cd181e8847409215.

Kubernetes-commit: f8b701243503fc10a037f86e77ce4df5741a07c6
This commit is contained in:
Harald Nordgren 2025-06-10 16:56:58 +02:00 committed by Kubernetes Publisher
parent 65d852d39c
commit ab62ac8cf1
2 changed files with 14 additions and 6 deletions

View File

@ -4570,12 +4570,14 @@ 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:\t%s\n", k, string(v))
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, "\nBinaryData\n====\n")
for _, k := range slices.Sorted(maps.Keys(configMap.BinaryData)) {
v := configMap.BinaryData[k]
w.Write(LEVEL_0, "%s:\t%s bytes\n", k, strconv.Itoa(len(v)))
w.Write(LEVEL_0, "%s: %s bytes\n", k, strconv.Itoa(len(v)))
}
w.Write(LEVEL_0, "\n")

View File

@ -721,13 +721,19 @@ 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>
`