kubernetes / kubectl

Issue tracker and mirror of kubectl code
Apache License 2.0
2.75k stars 894 forks source link

Support config get-contexts JSON output #1614

Open hclihn opened 1 week ago

hclihn commented 1 week ago

What would you like to be added: Please add support for config get-contexts JSON output.

Why is this needed: Currently, config get-contexts can only output column-oriented format or the name field (using -o=name). However, when the cluster/context name contains space(s) which is true for our company's implementation, it makes the parsing of the output very challenging. If the command output can support a JSON format, then it's relatively easier to use existing tools to parse it, regardless if the cluster/context name contains space(s) or not.

k8s-ci-robot commented 1 week ago

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
ardaguclu commented 1 week ago

Sounds to me a reasonable ask.