From f52fc54176e2e70d8e46874a7b1a897e5ff79b28 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Wed, 7 Sep 2016 14:25:56 +1000 Subject: [PATCH] Teach create-kubeconfig() to deal with multi path KUBECONFIG When KUBECONFIG is in the form "A:B:C" make sure each file is created. --- cluster/common.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 0b3c21b21e..af20222299 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -71,10 +71,16 @@ function create-kubeconfig() { fi # KUBECONFIG determines the file we write to, but it may not exist yet - if [[ ! -e "${KUBECONFIG}" ]]; then - mkdir -p $(dirname "${KUBECONFIG}") - touch "${KUBECONFIG}" - fi + OLD_IFS=$IFS + IFS=':' + for cfg in ${KUBECONFIG} ; do + if [[ ! -e "${cfg}" ]]; then + mkdir -p "$(dirname "${cfg}")" + touch "${cfg}" + fi + done + IFS=$OLD_IFS + local cluster_args=( "--server=${KUBE_SERVER:-https://${KUBE_MASTER_IP}}" )