mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-31 08:36:16 +00:00
Merge pull request #26244 from asalkeld/kconfig-common.sh
Automatic merge from submit-queue Teach create-kubeconfig() to deal with multi path KUBECONFIG When KUBECONFIG is in the form "A:B:C" make sure each file is created. fixes #17778
This commit is contained in:
@@ -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}}"
|
||||
)
|
||||
|
Reference in New Issue
Block a user