Fix libvirt-coreos cluster

KUBERNETES=libvirt-coreos cluster/kube-up.sh produced the following error:

cluster/../cluster/libvirt-coreos/../../cluster/common.sh: line 83: user_args[@]: unbound variable

This was coming from the fact that, as a libvirt-coreos cluster runs locally on local VMs,
there is no authentication mechanism. This led to have user_args of common.sh unset.

In the case of libvirt-coreos, it is in fact expected to have no authentication token.
This commit is contained in:
Lénaïc Huard
2015-07-16 18:05:18 +02:00
parent 8f3c3108b8
commit 3b4a31dc81
2 changed files with 3 additions and 8 deletions

View File

@@ -80,7 +80,9 @@ function create-kubeconfig() {
fi
"${kubectl}" config set-cluster "${CONTEXT}" "${cluster_args[@]}"
"${kubectl}" config set-credentials "${CONTEXT}" "${user_args[@]}"
if [ -n "${user_args[@]:-}" ]; then
"${kubectl}" config set-credentials "${CONTEXT}" "${user_args[@]}"
fi
"${kubectl}" config set-context "${CONTEXT}" --cluster="${CONTEXT}" --user="${CONTEXT}"
"${kubectl}" config use-context "${CONTEXT}" --cluster="${CONTEXT}"