-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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: Allow namespaces with prefix #123142
base: master
Are you sure you want to change the base?
Conversation
Strip the prefix from the namespace flag if it starts with "namespace/", "namespaces/", or "ns/" (case insensitive). This allows the output of `kubectl get ns -o name` to be used directly in subsequent commands.
|
Welcome @iCiaran! |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @iCiaran. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig cli |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: iCiaran The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/ok-to-test |
Hi @pwittrock, @seans3, would be great to get some feedback on this, thanks! |
Any reason why this hasn't been merged yet? That fix would be really appreciated. |
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.
/hold
At this point in time, I don't consider this regression anymore.
/remove-kind regression
The <resource>/<name>
pattern is good as an argument, where we need to explicitly specify resource type, for explicit flags, like -n
or especially better visible with --namespace namespace/xyz
it's overly verbose. Also this part can easily managed through some sort of cut
invocation to skip the namespace part.
@soltysh I really consider this a worthwhile QOL change that improves many of use cases. |
For me it's about having kubectl work in an intuitive way, in most (all?) other cases the As to the long gap - it's something that's bugged me for a couple of years, I just didn't get round to trying to do something about it until now. If not merging then a comment on #29271 noting that the original fix no longer works would be appreciated, it's where I (and I'm sure many others) ended up when searching for why you can't use |
What type of PR is this?
/kind bug
/kind regression
What this PR does / why we need it:
Strip the prefix from the namespace flag if it starts with "namespace/", "namespaces/", or "ns/" (case insensitive), allowing the output of
kubectl get ns -o name
to be used directly in subsequent commands.This was previously addressed in #50579, but lost in a refactor to config flag parsing (#63373).
Which issue(s) this PR fixes:
Fixes #29271
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: