Skip to content

Support kubectl config get-contexts JSON output #1614

@hclihn

Description

@hclihn

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.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions