Closed todd-dsm closed 7 years ago
So were you running bash 3.2 or bash 4 prior to this? It looks like the instructions are for bash-completion which should be for the bash installed by default in macOS. /assign
I always install the latest Bash, currently 4.4.12(1)-release. Apple's is too old and I'm not going live in their cave; most people won't - that's why homebrew is a huge project.
Correct, the instructions are for the stock version of Bash (presently 3.2.57(1)-release). My suggestion is to include instructions for both versions. Mostly to keep others from wasting the same time.
I've already done the testing so folding in the new details should be pretty straight-forward.
@todd-dsm: I've opened https://github.com/kubernetes/kubernetes.github.io/pull/3737 to update the kubernetes documentation, and https://github.com/Homebrew/homebrew-core/issues/13552 to potentially update how homebrew works to make this clearer.
Docs have been updated: https://kubernetes.io/docs/tasks/tools/install-kubectl/ /close
The web and
kubectl completion -h
instructions for Installing and Setting Up kubectl need a slight tuneup. The homebrew instructions should reflect a few different options for Bash on macOS.I lost an hour of my life to this; I hope this helps others.
What happened: By following the homebrew install instructions on this page, then entering
kubectl
and tabbing, this is the output:What you expected to happen: By following the same path as above this should be the output:
Anything else we need to know: Currently the instructions assume the default Bash on a vanilla macOS install; while I understand this being most-likely scenario, the default version of Bash is shamefully old.
After reviewing to options in homebrew it appears there are 2:
The Solution
For those of us that cannot live without all the options, this is how we do:
Install:
brew install bash shellcheck dash bash-completion@2 kubectl
Configure Then the
~/.bashrc
needs to be updated to reflect this changes:TEST
~/.bashrc
is sourced-in)kubectl
and tab twiceWe then get the expected result.
The requested details follow:
Kubernetes version (use
kubectl version
):Environment: personal/dev
uname -a
):Darwin hostname 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64 i386 MacBookPro11,3 Darwin