-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Make kubectl explain print the Kind and APIVersion of the resource #55689
Make kubectl explain print the Kind and APIVersion of the resource #55689
Conversation
/ok-to-test @kubernetes/sig-cli-maintainers |
Printer change /unassign |
@fabianofranz this lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabianofranz, luksa Associated issue requirement bypassed by: fabianofranz The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest Review the full test history for this PR. |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Kubectl explain currently doesn't print out the Kind and APIversion of the resource being explained. When running
kubectl explain hpa.spec
, for example, there is no way of knowing whether you're looking at theautoscaling/v1
or theautoscaling/v2beta1
version.Also,
kubectl explain
is often used as a reference when writing YAML/JSON object manifests. It allows you to look up everything except the API version. Currently, you either need to know the API Version of a resource by heart or look it up in the online API docs.This PR fixes both problems by having
kubectl explain
print out the full Kind and APIVersion of the resource it is explaining.Here are a few examples of the new output:
Release note: