ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.66k stars 1.26k forks source link

Autocomplete does not work when installed as Krew plugin #410

Open benjaminclauss opened 10 months ago

benjaminclauss commented 10 months ago
# Enable shell completion
autoload -U compinit; compinit

# Install Krew - the package manager for kubectl plugins
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

# https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion
source <(kubectl completion zsh)

I would expect kubectl ctx CL<tab><tab> to show CLUSTER.

ahmetb commented 9 months ago

It's a known problem, we need to implement shell completion installation in Krew first, then make this plugin's krew distribution use it.

nogweii commented 7 months ago

I believe this is now possible if there were a couple of commands installed: kubectl_complete-ctx and kubectl_complete-ns