-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
use containing API group when resolving shortname from discovery #58741
use containing API group when resolving shortname from discovery #58741
Conversation
/kind bug |
1b22e3b
to
d5facf7
Compare
@@ -115,6 +115,9 @@ func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionRes | |||
} |
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.
probably add the same check if version is present and not equal
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.
ah, nevermind... version isn't in the shortcut mapping
@dixudx A test in |
@@ -115,6 +115,9 @@ func (e shortcutExpander) expandResourceShortcut(resource schema.GroupVersionRes | |||
} | |||
if resource.Resource == item.ShortForm.Resource { | |||
resource.Resource = item.LongForm.Resource | |||
if len(resource.Group) == 0 { |
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 this should unconditionally set to item.LongForm.Group
d5facf7
to
97ec47b
Compare
@nikhita Tests have already been added. PTAL. Thanks. /cc @kubernetes/sig-cli-pr-reviews |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dixudx, liggitt Associated issue: #58695 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 |
Automatic merge from submit-queue (batch tested with PRs 58302, 58782, 58555, 58741). If you want to cherry-pick this change to another branch, please follow the instructions here. |
There is a bug before Kubernetes v1.10 that kubectl will incorrectly parse the shorthand resource name without checking the full name. It can result in `kubectl delete lhn --all` will be treated as `kubectl delete node --all`. The bug is kubernetes/kubernetes#58741 The bug has been fixed since v1.10 release.
There is a bug before Kubernetes v1.10 that kubectl will incorrectly parse the shorthand resource name without checking the full name. It can result in `kubectl delete lhn --all` will be treated as `kubectl delete node --all`. The bug is kubernetes/kubernetes#58741 The bug has been fixed since v1.10 release.
What this PR does / why we need it:
kubectl does not use containing API group when resolving shortname from discovery
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #58695
Special notes for your reviewer:
/assign @liggitt
/cc @nikhita @zjj2wry
Release note: