-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added hability to switch to a context using a partial name #331
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
This did come up in the past and I think (1) it's kinda dangerous as that might not always be the intent and might switch into an unintended context, especially in a non-interactive setting (2) fzf has a builtin flag/feature that does this (I believe "--select-1") (3) we are accepting new changes to the Go implementation at this point (4) there's #324 adding this (with fzf support). That's why I'm inclined to not pursue this. |
Would it be this accepted if I add this as a flag? For example: kubectl ctx -s example |
I think the fzf support already is going to offer this in the PR I linked so I don't think this should be a separate option like -s. Something like this makes sense only in the interactive context (i.e. not from a script) and in that scenario, we already have a fuzzy search integration with fzf for a long time now and we'll add tools like sk as well (there's an open issue on that too). So I am inclined to not accept this as a new option or to the bash script. The bash based script is rather small and static , feel free to maintain your fork. |
Sure, thank you for your feedback. I don't really like it to be interactive, that's why I have proposed this |
This PR is to be able to switch to the context if only one matches. This is intended for EKS clusters where the default context name is the ARN (arn:aws:eks:REGION:ACCOUNTNUMBER:cluster/CLUSTERNAME) which is quite long but includes the cluster name