Skip to content

Commit

Permalink
updated .envrc-gcp
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Dec 7, 2024
1 parent e4f8c63 commit 7b9781f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .envrc-gcp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export CLOUDSDK_CONTAINER_CLUSTER=mycluster # GKE cluster name
# export CLOUDSDK_CONTAINER_CLUSTER="${gke_clusters[*]}"
#fi

gke_clusters="$(gcloud container clusters list --format='get(name)')"
gke_clusters="$(
gcloud container clusters list --format='get(name)' |
sed '/^[[:space:]]*$/d'
)"

if [ -n "$gke_clusters" ]; then
num_gke_clusters="$(grep -c . <<< "$gke_clusters")"
Expand All @@ -149,6 +152,8 @@ if [ -n "$gke_clusters" ]; then
GKE_CLUSTER="$gke_clusters"
fi
fi
else
num_gke_clusters=0
fi

# alternatively call gke_kube_context() function in .envrc-kubernetes which will do this
Expand Down

0 comments on commit 7b9781f

Please sign in to comment.