origin: ZSH Completion not working: command not found: __kubectl_debug

zsh completion fails after trying to complete (i.e: press <kbd>tab</kbd>) on a file after a -f argument.

Version

oc v3.10.0+dd10d17 kubernetes v1.10.0+b81c8f8 features: Basic-Auth

Server https://192.168.64.37:8443 openshift v3.10.0+a5e4ac9-10 kubernetes v1.10.0+b81c8f8

Steps To Reproduce
  1. zsh -i
  2. source <(oc completion zsh)
  3. oc create -f <kbd>TAB</kbd>
Current Result

__kubectl_filedir:20: command not found: __kubectl_debug

Expected Result

Completion after -f on files

Additional information

zsh 5.5.1 (x86_64-apple-darwin17.5.0)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

I guess as a workaround you can just do a :

% source <(kubectl completion zsh)

just before doing the source of oc completion zsh to get it to work.

whoever that needs it, that’s the solution,

Wow… For so long I have been iritated by this bug and the solution is THAT simple! Thanks @chmouel!!!

Alternatively, add kubectl to the list of plugins in your ~/.zshrc