-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
kubectl code cleanup: overhaul the resource alias introduced #6573 #22337
Comments
cc: @deads2k @kubernetes/kubectl |
I don't see aliases are related the I think I'd like to see a new interface for the expansion plumbed through where it's used as opposed to piggy-backing on the |
Thanks @deads2k. I agree it shouldn't be part of the RESTMapper. |
"kubectl run" changed behavior to create deployments by default. A user mentioned in #23604 (comment):
|
We should use the discovery client when we start combining resources from different api groups into the same aliases. |
Added more things from the list here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159 Update the devel/kubectl-conventions.md with the rules mentioned by a few folks on which resources could be added to the special 'all' alias Related to a suggestion in issue kubernetes#22337
Automatic merge from submit-queue Extend all to more resources Added more things from the list here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159 Note, did not add events as it did not seem useful to me. Since this is just a list of messages generated by the system. Related to a suggestion in issue #22337
Added more things from the list here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159 Update the devel/kubectl-conventions.md with the rules mentioned by a few folks on which resources could be added to the special 'all' alias Related to a suggestion in issue kubernetes#22337
Automatic merge from submit-queue Extend all to more resources Added more things from the list here: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159 Note, did not add events as it did not seem useful to me. Since this is just a list of messages generated by the system. Related to a suggestion in issue kubernetes#22337
/sig cli |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
#6573 introduces the alias for resources. As our code base evolves, this code needs overhaul. I've noticed several problems:
aliasToResource
is a global variable, so everyDefaultRESTMapper
has the same alias map. https://github.com/kubernetes/kubernetes/blob/master/pkg/api/meta/restmapper.go#L492(This hasn't caused any bug yet because the problem is hidden by
SplitResourceArgument
)"rc", "svc", "pods", "pvc"
. I think this map needs to be updated. And I'd suggest use another alias, because kubectl also has a flag--all
, which is confusing.FWIW, I thought about using our ShortcutExpander to replace the alias code, but it doesn't seem to work because they are in different stages of the cmdline argument processing.
@Kargakis @janetkuo
The text was updated successfully, but these errors were encountered: