-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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 parsing of local flags with no args appearing before the command name is broken or at best, confusing #93432
Comments
This isn't specific to --all-namespaces, it applies to any non-global flag (or unknown flag) that comes before the command name. The following produce the same error:
I guess when cobra encounters unknown/non-global flags it assumes they consume one following arg, while locating the command to run |
new contributor, would like tot take this one |
I think this probably has to be fixed upstream in spf13/cobra |
/cc @knight42 I remember you have worked on this before. |
@zhouya0 I think this issue is slightly different from kubernetes/kubectl#884. As @liggitt described in #93432 (comment), I believe this is more likely to be a cobra issue. |
ok, so @thockin this indeed seems like a cobra issue |
Issues go stale after 90d 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. |
/remove-lifecycle stale |
What happened:
Running a
kubectl get
with --all-namespaces in the wrong place consumes one extra argument, resulting in a confusing error.What you expected to happen:
A sane error.
How to reproduce it (as minimally and precisely as possible):
Environment:
This is a kubectl build at HEAD
/sig cli
The text was updated successfully, but these errors were encountered: