Created
July 21, 2020 00:43
-
-
Save DylanGraham/73ee54702e915645c0ff9faac734b4c7 to your computer and use it in GitHub Desktop.
Update kubectx short names after upgrade on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
local_dir="/usr/local/bin" | |
kctx_dir="/usr/local/Cellar/kubectx" | |
cd $kctx_dir | |
new_dir=$(find . -type d -d 1 -name "*\.*\.*" | sed 's/^\.\///') | |
rm -f latest | |
ln -s $new_dir latest | |
rm $local_dir/{kubectx,kubens,kctx,kns} | |
ln -s $kctx_dir/$new_dir/bin/kubectx $local_dir/kctx | |
ln -s $kctx_dir/$new_dir/bin/kubens $local_dir/kns | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment