-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(version): Add JSON/YAML output formats for version command #709
feat(version): Add JSON/YAML output formats for version command #709
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@navidshaikh: 1 warning.
In response to this:
Fixes #513
Description:
Add -o flag to
kn version
command and support JSON/YAML formats.Changes
Examples:
➜ client git:(pr/kn-version-json) kn version -ojson { "Version": "v20200309-local-1cbb94e2-dirty", "BuildDate": "2020-03-09 13:35:39", "GitRevision": "1cbb94e2", "SupportedAPIs": { "eventing": [ "sources.eventing.knative.dev/v1alpha1 (knative-eventing v0.13.1)", "sources.eventing.knative.dev/v1alpha2 (knative-eventing v0.13.1)", "eventing.knative.dev/v1alpha1 (knative-eventing v0.13.1)" ], "serving": [ "serving.knative.dev/v1 (knative-serving v0.13.0)" ] } }
and
➜ client git:(pr/kn-version-json) kn version -oyaml BuildDate: "2020-03-09 13:35:39" GitRevision: 1cbb94e2 SupportedAPIs: eventing: - sources.eventing.knative.dev/v1alpha1 (knative-eventing v0.13.1) - sources.eventing.knative.dev/v1alpha2 (knative-eventing v0.13.1) - eventing.knative.dev/v1alpha1 (knative-eventing v0.13.1) serving: - serving.knative.dev/v1 (knative-serving v0.13.0) Version: v20200309-local-1cbb94e2-dirty
/lint
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: navidshaikh 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:
Approvers can indicate their approval by writing |
/cc: @joshuawilson |
That looks good. What will be different when the version is a released version instead of a local build? |
@joshuawilson:
while for released build:
rest of the fields should stay intact |
Thanks for fixing this. |
@joshuawilson thanks for the review! /assign @rhuss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with some a minor improvement suggestion.
@navidshaikh do you want to address that now or ok to do it post 0.13.0 ?
The following is the coverage report on the affected files.
|
/lgtm |
@rhuss: addressed the review comment. |
Fixes #513
Description:
Add -o flag to
kn version
command and support JSON/YAML formats.Changes
Examples:
and
/lint