Last active
May 28, 2019 15:44
-
-
Save mgoodness/c0b0f887c962ef050d5411efb3befc9a to your computer and use it in GitHub Desktop.
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
kube-context() { | |
if [[ -n "$1" ]]; then | |
context=$1 | |
else | |
context=$(kubectl config get-contexts \ | |
| fzf --header-lines=1 --no-multi \ | |
| awk '{if ($1!="*") print $1; else print $2 }') | |
fi | |
[[ -n ${context} ]] && kubectl config use-context ${context} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment