-
Notifications
You must be signed in to change notification settings - Fork 40.7k
Add machine readable --output options to kubectl api-resources
#116926
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
Conversation
Signed-off-by: Anant Vijay <anantvijay3@gmail.com>
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Sat Mar 25 16:24:30 UTC 2023. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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 NOT APPROVED This pull-request has been approved by: XDRAGON2002 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@@ -235,6 +238,15 @@ func (o *APIResourceOptions) RunAPIResources() error { | ||
strings.Join(r.APIResource.Categories, ",")); err != nil { | ||
errs = append(errs, err) | ||
} | ||
case "json": |
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.
Could you please check how other commands handle json printing(i.e. commands support --output
). We need to also support yaml and that's why, we need to use JsonYamlPrinter.
Since this version of this patch looks hacky;
/hold
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.
@XDRAGON2002 It is worth to check how wait
command handles this
printer, err := flags.PrintFlags.ToPrinter() |
@ardaguclu Thanks for the quick review! Though while going through the Any pointers or suggestions regarding how can I improve the implementation? |
@XDRAGON2002: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds support for json output format for
kubectl api-resources
.Which issue(s) this PR fixes:
Fixes kubernetes/kubectl#1382
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: