From 1c265f37845cedc7ae71b6ec9a456c79aed93aa7 Mon Sep 17 00:00:00 2001 From: Jeff Lowdermilk Date: Fri, 17 Apr 2015 16:22:07 -0700 Subject: [PATCH] export KUBECONFIG so callers of common.sh functions can use it --- cluster/common.sh | 6 +++--- cluster/gce/util.sh | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 285853f0d7..56d7d804ac 100644 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -38,7 +38,7 @@ DEFAULT_KUBECONFIG="${HOME}/.kube/config" function create-kubeconfig() { local kubectl="${KUBE_ROOT}/cluster/kubectl.sh" - KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} + export KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} # KUBECONFIG determines the file we write to, but it may not exist yet if [[ ! -e "${KUBECONFIG}" ]]; then mkdir -p $(dirname "${KUBECONFIG}") @@ -63,7 +63,7 @@ function create-kubeconfig() { # KUBECONFIG # CONTEXT function clear-kubeconfig() { - KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} + export KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} local kubectl="${KUBE_ROOT}/cluster/kubectl.sh" "${kubectl}" config unset "clusters.${CONTEXT}" "${kubectl}" config unset "users.${CONTEXT}" @@ -89,7 +89,7 @@ function clear-kubeconfig() { # KUBE_USER,KUBE_PASSWORD will be empty if no current-context is set, or # the current-context user does not exist or contain basicauth entries. function get-kubeconfig-basicauth() { - KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} + export KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} # Templates to safely extract the username,password for the current-context # user. The long chain of 'with' commands avoids indexing nil if any of the # entries ("current-context", "contexts"."current-context", "users", etc) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 469ed8620e..c24dd3c2bf 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -830,7 +830,6 @@ function kube-down { --quiet \ "${MASTER_NAME}-ip" || true - export KUBECONFIG="${HOME}/.kube/.kubeconfig" export CONTEXT="${PROJECT}_${INSTANCE_PREFIX}" clear-kubeconfig }