Cannot get kubectl
bash completion to work on Mac. I installed bash-completion
with brew
i.e. brew install bash-completion
then as per the install notes, added it to the ~/.bash_profile
:
if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi
But still getting the error kubectl -bash: _init_completion: command not found
after re-sourcing the profile.
A patch was provided to fix the issue with bash completion for kubectl. You'll need to use the patch for now if you are on osx until the PR is merged and source the bash completion again, you will also need to install bash-completion
as described in the question above.
Edit: this was now merged into master