mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
use current-context from .kube/config when getting cluster credentials
This commit is contained in:
parent
17e36b02f4
commit
8ecfd967d5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user