kubectx
kubectx copied to clipboard
Display fzf when provided with an invalid context
When provided with an invalid (non-existant) context kubectx currently just errors out.
This PR allows providing a substring instead of the whole context name, if there's only one match, it uses that.
Example:
Given the contexts ["production", "staging", "development", "development-load"]
Before:
kubectx pro
error: no context exists with the name: "pro"
After:
kubectx pro
error: no context exists with the name: "pro"
Switched to context "production"
Before
kubectx dev
error: no context exists with the name: "dev"
After:
kubectx dev
error: no context exists with the name: "dev"
# <opens fzf with --query dev which displays "development" and "development-load">
I'd love to have this feature, it's very convenient to use partial identifiers