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: fix plugin lookup with positional arguments #124123
kubectl: fix plugin lookup with positional arguments #124123
Conversation
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@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: Sun Mar 31 14:12:16 UTC 2024. |
I had a long conversation with Stefan about this topic. tl;dr is this is not exposing the create plugins shadowing mechanism to anything unexpected. It only addresses a problem where a user wants to use a positional argument in their create plugin. For example, /triage accepted |
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.
/lgtm
/approve
LGTM label has been added. Git tree hash: 18f099f4fdb34f2569d1b33d5e2c3992c71229f1
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh, sttts The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Without this PR, a plugin is found for
kubectl create foo --flags
, butkubectl create foo bar --flags
is not even thoughkubectl-create-foo
exists.This PR fixes the plugin search algorithm by not looking for an exact match, but letting it try from longest to shortest plugin command, but longer than the command (
create
) that is extended.Note:
kubectl create
is explicitly a command whose subcommands can be overwritten (it's the only one).Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: