Skip to content

Instantly share code, notes, and snippets.

@kenpusney
Created October 8, 2018 10:34
Show Gist options
  • Save kenpusney/b153427aef1b2035d209dace486caadc to your computer and use it in GitHub Desktop.
Save kenpusney/b153427aef1b2035d209dace486caadc to your computer and use it in GitHub Desktop.
#!/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