mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Future proof GKE kubeconfig handling in e2e driver
This commit is contained in:
parent
b7289b606e
commit
6523d18130
@ -105,10 +105,10 @@ if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then
|
|||||||
config=(
|
config=(
|
||||||
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
|
"--context=gke_${PROJECT}_${ZONE}_${CLUSTER_NAME}"
|
||||||
)
|
)
|
||||||
# In gcloud versions prior to 0.9.59, GKE stores it's kubeconfig
|
# In gcloud versions prior to 0.9.59, GKE stores its kubeconfig
|
||||||
# in a separate location. If the file doesn't exist, then use
|
# in a separate location. If the file doesn't exist, then use
|
||||||
# the default kubeconfig file.
|
# the default kubeconfig file.
|
||||||
# TODO(roberthbailey): Remove this once gcloud 0.9.59 is released.
|
# TODO(roberthbailey): Remove this once gcloud 0.9.59 or above is released.
|
||||||
if [[ -e "${HOME}/.config/gcloud/kubernetes/kubeconfig" ]]; then
|
if [[ -e "${HOME}/.config/gcloud/kubernetes/kubeconfig" ]]; then
|
||||||
config+=(
|
config+=(
|
||||||
"--kubeconfig=${HOME}/.config/gcloud/kubernetes/kubeconfig"
|
"--kubeconfig=${HOME}/.config/gcloud/kubernetes/kubeconfig"
|
||||||
|
@ -87,7 +87,10 @@ if [[ -z "${AUTH_CONFIG:-}" ]]; then
|
|||||||
|
|
||||||
detect-master >/dev/null
|
detect-master >/dev/null
|
||||||
|
|
||||||
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
# In gcloud versions < 0.9.59, GKE stores its kubeconfig in a separate
|
||||||
|
# location.
|
||||||
|
# TODO: Remove this once gcloud 0.9.59 or above is released.
|
||||||
|
if [[ "${KUBERNETES_PROVIDER}" == "gke" && -e "${GCLOUD_CONFIG_DIR}/kubeconfig" ]]; then
|
||||||
# GKE stores its own kubeconfig in gcloud's config directory.
|
# GKE stores its own kubeconfig in gcloud's config directory.
|
||||||
detect-project &> /dev/null
|
detect-project &> /dev/null
|
||||||
auth_config=(
|
auth_config=(
|
||||||
|
Loading…
Reference in New Issue
Block a user