-
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
A new command to read types' description from Swagger - kubectl explain #12677
Conversation
GCE e2e build/test passed for commit 574663305ceb07207e3583ac0e8a294b8f4223f1. |
GCE e2e build/test passed for commit fdef9f45ac103cd36641c3210a53e33160a008cb. |
GCE e2e build/test passed for commit b66283478f6d4fbc572180525c9a3cde3b53fce1. |
GCE e2e build/test passed for commit 2d64923001cca38089da9de40ccde5616080e593. |
GCE e2e build/test passed for commit 96663b6dba3b421c62f34a3947b9210c98ed85e1. |
Lots of changes. Added a dot notation feature for better exploration. Thanks @ghodss for the nice ideas and suggestions :) |
GCE e2e build/test passed for commit a80b32db433a55fc503c38234701123f9f43c571. |
GCE e2e build/test failed for commit 104ddbe35f01870362ef0346df525b93d805a68e. |
cc @kubernetes/kubectl |
This implements #3060. |
@pweil- This ought to help the detection issue you wrote in openshift. |
GCE e2e build/test passed for commit c866a9fac8993aabe906c2f5413278beabbc3f98. |
for _, model := range args { | ||
if cmdutil.GetFlagBool(cmd, "search") { | ||
kubectl.SearchForModel(model, apiV, out, client) | ||
} else { |
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.
Make GetModelDescription
and SearchForModel
return errors instead of os.Exit
so they can be used directly in return statements (will make this else clause redundant).
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.
Great, thanks! I am on it.
Labelling this PR as size/XL |
Thanks a lot @andronat. This is exciting stuff! For ex the current proposed |
@@ -86,6 +86,7 @@ kubectl | |||
* [kubectl create](kubectl_create.md) - Create a resource by filename or stdin | |||
* [kubectl delete](kubectl_delete.md) - Delete resources by filenames, stdin, resources and names, or by resources and label selector. | |||
* [kubectl describe](kubectl_describe.md) - Show details of a specific resource or group of resources | |||
* [kubectl doc](kubectl_doc.md) - Print model's documentation through swagger's API. |
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.
I think we can do without specifying "swagger" here. Many kubectl users might not know what swagger is and dont need to.
If we decide to change this to kubectl get kind, then we can say "Show the fields of a given kind"
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.
done
GCE e2e build/test passed for commit 344b2c6ea66e43ca898311a50410c04c9d98376c. |
Labelling this PR as size/XL |
GCE e2e build/test passed for commit 344b2c6ea66e43ca898311a50410c04c9d98376c. |
@andronat thanks for the update. I think the map needs to be updated since operations like |
@janetkuo yea, I fixed the problems |
GCE e2e build/test passed for commit bff4e1046c7b29eb4d9737e816cca8821da2ca2c. |
@andronat thanks, this LGTM now. Please update the description of this PR (the first comment) to reflect the latest change. @bgrant0607 may have more comments. |
Thanks for all the work on this. We can improve it more later. Please rebase and squash. |
Labelling this PR as size/L |
Unit, integration and GCE e2e test build/test passed for commit e8b9dde. |
I updated the description and squashed the commits. |
The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label? |
A new command to read types' description from Swagger - kubectl explain
This is a simple kubectl tool that parses the swagger schema and returns useful information for the various resources and their fields that we have.
Here you can see an example output:
and has this interface:
/cc @ghodss