openshift / kube-compare

A Kubectl plugin to allow to compare a known valid reference configuration and a set of specific cluster configuration CRs.
Apache License 2.0
8 stars 8 forks source link

Add option to format output as JSON/YAML #12

Closed AlinaSecret closed 1 month ago

AlinaSecret commented 1 month ago

A new flag '-o' ('output') is introduced, allowing the user to choose the output format of the command. The options are json/yaml/human. The default behavior remains the same, with output in 'human' format. The flag supports auto-completion for the output format options, implemented in the code of the command. To enable auto-completion when using the command as a plugin, an additional file 'kubectl_complete-cluster_compare' was added. The file should be present in a location in PATH along with the plugin to enable auto-completion. Also added supporting tests for JSON and YAML output modes.

AlinaSecret commented 1 month ago

/hold

depends on https://github.com/openshift/kube-compare/pull/10

AlinaSecret commented 1 month ago

/unhold

pixelsoccupied commented 1 month ago

/lgtm /approve

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pixelsoccupied

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/kube-compare/blob/main/OWNERS)~~ [pixelsoccupied] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 1 month ago

@AlinaSecret: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).