Future proof GKE kubeconfig handling in e2e driver

This commit is contained in:
Jeff Lowdermilk 2015-05-11 09:57:54 -07:00
parent b7289b606e
commit 6523d18130
2 changed files with 6 additions and 3 deletions

View File

@ -105,10 +105,10 @@ if [[ "$KUBERNETES_PROVIDER" == "gke" ]]; then
config=(
"--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
# 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
config+=(
"--kubeconfig=${HOME}/.config/gcloud/kubernetes/kubeconfig"

View File

@ -87,7 +87,10 @@ if [[ -z "${AUTH_CONFIG:-}" ]]; then
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.
detect-project &> /dev/null
auth_config=(