updated kubernetes_foreach_context.sh

pull/2/head
Hari Sekhon 4 years ago
parent d32a7fb2be
commit e38ccd7df2

@ -56,7 +56,7 @@ cmd_template="$*"
# XXX: critical to protect current environment from imperative kubectl concurrency race conditions because changes the current context - so isolate to only this script's environment
kubeconfig="/tmp/.kube/config.${EUID:-$UID}.$$"
mkdir -pv "$(dirname "$kubeconfig")"
cp "${KUBECONFIG:-$HOME/.kube/config}" "$kubeconfig"
cp -f "${KUBECONFIG:-$HOME/.kube/config}" "$kubeconfig"
export KUBECONFIG="$kubeconfig"
# don't need to store this any more as we now switch the KUBECONFIG which is only used for the lifetime of this script

Loading…
Cancel
Save