-
-
Save rrichards/429731269298e38ef969ef06d946964e to your computer and use it in GitHub Desktop.
This file contains hidden or 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