kubectl icon indicating copy to clipboard operation
kubectl copied to clipboard

Improving legibility of `kubectl describe configmap` output

Open siddhantvirus opened this issue 1 year ago • 2 comments

What would you like to be added:

I would like to change the way kubectl describve configmap outputs data values.

Why is this needed:

This is needed to improve legibility of the output and can also be used to make parsing of the output better.

This is the current output style.

kubectl create configmap sample --from-literal=sample1=value1 --from-literal=sample2=value2

image

And I propose the output to look like -

Name:         sample
Namespace:    default
Labels:       <none>
Annotations:  <none>

Data
====
sample1:
----
value1

sample2:
----
value2


BinaryData
====

Events:  <none>

Where the value of the first key is separated from the next key by a new line. We could also use a different separator value.

I have identified the code where we need to make changes and if assigned to me, would fix it right away

siddhantvirus avatar Feb 12 '24 10:02 siddhantvirus

/triage accepted This seems to be a general issue with the describe printer, because it is simply printing to the write buffer directly. There are many improvements that could be made here. I think one thing to consider here is that we should probably add more ---- style line breaks to make the boundaries of fields more obvious to the eye.

mpuckett159 avatar Feb 29 '24 00:02 mpuckett159

/assign

@mpuckett159 , I agree, but I feel there might have to be a larger discussion in case we need to modify the generic behaviour of the describe printer

In any case, since this issue is now accepted, I'll just assign it to myself and work on it

siddhantvirus avatar Feb 29 '24 04:02 siddhantvirus