WispyCloud
WispyCloud

Reputation: 4230

kubectl -bash: _init_completion: command not found

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.

Upvotes: 6

Views: 4878

Answers (1)

WispyCloud
WispyCloud

Reputation: 4230

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.

kubectl patch

kubernetes pull request

Edit: this was now merged into master

Upvotes: 1

Related Questions