Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit c5d174c

Browse files
Simon Emmsmrsimonemms
authored andcommitted
Get default GKE version from CLI if GKE_VERSION not set
1 parent 632bdd9 commit c5d174c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

setup.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ DNS_SA_EMAIL="${DNS_SA}"@"${PROJECT_NAME}".iam.gserviceaccount.com
3030
SERVICES_POOL="workload-services"
3131
WORKSPACES_POOL="workload-workspaces"
3232

33-
GKE_VERSION=${GKE_VERSION:="1.20.8-gke.900"}
34-
3533
GITPOD_VERSION=${GITPOD_VERSION:="aledbf-mk3.68"}
3634

3735
function check_prerequisites() {
@@ -318,6 +316,15 @@ function install() {
318316
echo "Cluster with name ${CLUSTER_NAME} already exists. Skip cluster creation.";
319317
gcloud container clusters get-credentials --region="${REGION}" "${CLUSTER_NAME}"
320318
else
319+
if [ -z "${GKE_VERSION}" ]; then
320+
echo "Getting default version from regular channel"
321+
GKE_VERSION=$(gcloud container get-server-config \
322+
--flatten="channels" \
323+
--filter="channels.channel=REGULAR" \
324+
--format="value(channels.defaultVersion)" \
325+
--region="${REGION}")
326+
fi
327+
321328
# shellcheck disable=SC2086
322329
gcloud container clusters \
323330
create "${CLUSTER_NAME}" \

0 commit comments

Comments
 (0)