1
0
mirror of https://github.com/HariSekhon/DevOps-Bash-tools.git synced 2025-02-06 09:28:21 +00:00

updated .envrc-gcp
All checks were successful
SonarCloud / SonarCloud (push) Has been skipped

This commit is contained in:
Hari Sekhon 2024-12-07 07:11:12 +07:00
parent e4f8c634e3
commit 7b9781f4fb

View File

@ -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")"
@ -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