Created
October 8, 2018 10:34
-
-
Save kenpusney/b153427aef1b2035d209dace486caadc 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
#!/usr/bin/env bash | |
KUBEENV=$1 | |
KUBECFG="${HOME}/.kube/config.${KUBEENV}" | |
TARGET="${HOME}/.kube/config" | |
die() { | |
echo $1 | |
exit 1 | |
} | |
[ -e $KUBECFG ] || die "No config for env ${KUBEENV} found, do you mean 'kubectl'?" | |
cp -f $KUBECFG $TARGET && echo "Kube config '${KUBEENV}' applied." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment