-
Notifications
You must be signed in to change notification settings - Fork 368
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
Krew completion (for fish, likely others as well) only works if ln -s kubectl-krew krew, and even then not in kubectl krew #810
Comments
as suggested to be added to the doc in #811, as at least a first step |
Krew doesn't offer completion, because kubectl plugins don't support completion yet. If it appears like krew does have completion scripts, it's a side effect of the library we use, not by design. /close |
@ahmetb: Closing this issue. In response to this:
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. |
also the next time we publish a new version the |
With the latest kubectl version (1.26), the kubectl plugins completion now works! To enable completion for echo '#!/bin/sh\nkubectl krew __complete "$@"' >~/.krew/bin/kubectl_complete-krew
chmod u+x ~/.krew/bin/kubectl_complete-krew |
@maelvls we should probably implement a native feature for this in the plugin manifest. Do you mind opening a separate issue so I don't forget? |
I think #812 covers this 👍 |
For anyone using zi or zinit, this is a workaround.
# kubecm 多集群配置管理工具
zi lucid wait'1' has"kubectl-kc" for \
id-as"kubecm_completion" \
from"{{ choose_github_mirror() }}" \
as"completion" \
atclone"kubectl-kc completion zsh > _kubecm; zinit creinstall -q kubecm_completion" \
atinit"ln -sf $HOME/.krew/bin/kubectl-kc $ZPFX/bin/kubecm;
compdef _kubecm kubectl-kc;
echo '#!/bin/sh\nkubectl kc __complete \"\$@\"' > $HOME/.krew/bin/kubectl_complete-kc;
chmod +x $HOME/.krew/bin/kubectl_complete-kc" \
atpull"%atclone" \
run-atpull \
z-shell/null
# Krew kubectl 插件管理器
zi lucid wait'1' has"kubectl-krew" for \
id-as"krew_completion" \
from"{{ choose_github_mirror() }}" \
as"completion" \
atclone"kubectl-krew completion zsh > _krew; zinit creinstall -q krew_completion" \
atinit"ln -sf $HOME/.krew/bin/kubectl-krew $ZPFX/bin/krew;compdef _krew kubectl-krew;
echo '#!/bin/sh\nkubectl krew __complete \"\$@\"' > $HOME/.krew/bin/kubectl_complete-krew;
chmod +x $HOME/.krew/bin/kubectl_complete-krew" \
atpull"%atclone" \
run-atpull \
z-shell/null |
@maelvls this is how it works for me and thank you for the hack )) |
#769 similar issue
When installing krew as per https://krew.sigs.k8s.io/docs/user-guide/setup/install/, for Fish (but it's likely similar for other shells),
and then activating completion like this:
then
kubectl krew ...
still doesn't auto-complete. However if doing:then at least
krew ...
auto-completes.The text was updated successfully, but these errors were encountered: