kubectl -bash: _init_completion: command not found
Asked Answered
K

1

6

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.

Knotted answered 3/9, 2015 at 20:0 Comment(0)
K
1

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

Knotted answered 3/9, 2015 at 20:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.