jordanwilson230 / kubectl-plugins

A Collection of Plugins for kubectl Integration (exec as any user, context switching, etc).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kubectl-switch should pick exact match if available

lathspell opened this issue · comments

Is your feature request related to a problem? Please describe.
I have contexts like "stage-foo", "stage-foo-bar", "stage-foo-baz" because those are the names of the k8s namespaces. When doing "k switch cluster stage-foo-bar" I get an error because it selects all three cluster names and then does something like "kubectl config use-context stage-foo stage-foo-bar stage-foo-baz".

The globbing feature is really nice but if there is an exact match, it should be preferred.

@lathspell Sorry, I've been away for some time.
Let me know if this works.