From d55666043bf00a30c0698c5dbbd1645769f91c34 Mon Sep 17 00:00:00 2001 From: Jeff Lowdermilk Date: Mon, 2 Nov 2015 14:05:33 -0800 Subject: [PATCH] Fix last current-context command in cluster/common.sh --- cluster/common.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index e27d15cf2b..19874017e0 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -115,9 +115,8 @@ function clear-kubeconfig() { "${kubectl}" config unset "users.${CONTEXT}-basic-auth" "${kubectl}" config unset "contexts.${CONTEXT}" - local current - current=$("${kubectl}" config view -o jsonpath='{.current-context}') - if [[ "${current}" == "${CONTEXT}" ]]; then + local cc=$("${kubectl}" config view -o jsonpath='{.current-context}') + if [[ "${cc}" == "${CONTEXT}" ]]; then "${kubectl}" config unset current-context fi @@ -147,7 +146,7 @@ function tear_down_alive_resources() { function get-kubeconfig-basicauth() { export KUBECONFIG=${KUBECONFIG:-$DEFAULT_KUBECONFIG} - local cc="current-context" + local cc=$("${KUBE_ROOT}/cluster/kubectl.sh" config view -o jsonpath="{.current-context}") if [[ ! -z "${KUBE_CONTEXT:-}" ]]; then cc="${KUBE_CONTEXT}" fi