Commit a963a05a authored by Jeff Lowdermilk's avatar Jeff Lowdermilk

Merge pull request #16683 from mikedanese/get-current-context

use current-context from .kube/config when getting cluster credentials
parents 17e36b02 8ecfd967
...@@ -179,7 +179,7 @@ function gen-kube-basicauth() { ...@@ -179,7 +179,7 @@ function gen-kube-basicauth() {
function get-kubeconfig-bearertoken() { function get-kubeconfig-bearertoken() {
export KUBECONFIG=${KUBECONFIG:-$DEFAULT_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 if [[ ! -z "${KUBE_CONTEXT:-}" ]]; then
cc="${KUBE_CONTEXT}" cc="${KUBE_CONTEXT}"
fi fi
...@@ -229,7 +229,7 @@ function load-or-gen-kube-bearertoken() { ...@@ -229,7 +229,7 @@ function load-or-gen-kube-bearertoken() {
function detect-master-from-kubeconfig() { function detect-master-from-kubeconfig() {
export KUBECONFIG=${KUBECONFIG:-$DEFAULT_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 if [[ ! -z "${KUBE_CONTEXT:-}" ]]; then
cc="${KUBE_CONTEXT}" cc="${KUBE_CONTEXT}"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment