From 8ecfd967d59697e23d98804e330c572044d1bdb2 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Mon, 2 Nov 2015 13:11:29 -0800 Subject: [PATCH] use current-context from .kube/config when getting cluster credentials --- cluster/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/common.sh b/cluster/common.sh index 6a262f6e964..e27d15cf2b3 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -179,7 +179,7 @@ function gen-kube-basicauth() { function get-kubeconfig-bearertoken() { 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 @@ -229,7 +229,7 @@ function load-or-gen-kube-bearertoken() { function detect-master-from-kubeconfig() { 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