Skip to content

Commit 00ebab1

Browse files
committed
pkg/steps/clusterinstall/template: Get region from Boskos lease
Like openshift/release@7aa198b3c7 (ci-operator/step-registry/ipi/conf/azure: Get region from Boskos lease, 2020-10-14, openshift/release#12584), but for AWS and GCP here too, now that we have evidence that the approach is working. I'm keeping a switch for AWS to give folks a pattern for selecting zones, if AWS breaks a zone in a particular region. We should probably distribute that (and the shared subnets, for shared-subnet tests?) via leases as well, but baby steps.
1 parent a818b3e commit 00ebab1

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

pkg/steps/clusterinstall/template.go

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,6 @@ objects:
402402
value: /etc/openshift-installer/.awscred
403403
- name: AZURE_AUTH_LOCATION
404404
value: /etc/openshift-installer/osServicePrincipal.json
405-
- name: GCP_REGION
406-
value: us-east1
407405
- name: GCP_PROJECT
408406
value: openshift-gce-devel-ci
409407
- name: GOOGLE_CLOUD_KEYFILE_JSON
@@ -495,14 +493,11 @@ objects:
495493
elif has_variant "compact"; then
496494
master_type=m5.2xlarge
497495
fi
498-
case $((RANDOM % 4)) in
499-
0) AWS_REGION=us-east-1
496+
AWS_REGION="${LEASED_RESOURCE}"
497+
case "${AWS_REGION}" in
498+
us-east-1)
500499
ZONE_1=us-east-1b
501500
ZONE_2=us-east-1c;;
502-
1) AWS_REGION=us-east-2;;
503-
2) AWS_REGION=us-west-1;;
504-
3) AWS_REGION=us-west-2;;
505-
*) echo >&2 "invalid AWS region index"; exit 1;;
506501
esac
507502
echo "AWS region: ${AWS_REGION} (zones: ${ZONE_1:-${AWS_REGION}a} ${ZONE_2:-${AWS_REGION}b})"
508503
subnets="[]"
@@ -564,17 +559,7 @@ objects:
564559
EOF
565560
566561
elif [[ "${CLUSTER_TYPE}" == "azure4" ]]; then
567-
case $((RANDOM % 8)) in
568-
0) AZURE_REGION=centralus;;
569-
1) AZURE_REGION=centralus;;
570-
2) AZURE_REGION=centralus;;
571-
3) AZURE_REGION=centralus;;
572-
4) AZURE_REGION=centralus;;
573-
5) AZURE_REGION=centralus;;
574-
6) AZURE_REGION=eastus2;;
575-
7) AZURE_REGION=westus;;
576-
*) echo >&2 "invalid Azure region index"; exit 1;;
577-
esac
562+
AZURE_REGION="${LEASED_RESOURCE}"
578563
echo "Azure region: ${AZURE_REGION}"
579564
580565
vnetrg=""
@@ -612,6 +597,7 @@ objects:
612597
${SSH_PUB_KEY}
613598
EOF
614599
elif [[ "${CLUSTER_TYPE}" == "gcp" ]]; then
600+
GCP_REGION="${LEASED_RESOURCE}"
615601
master_type=null
616602
if has_variant "xlarge"; then
617603
master_type=n1-standard-32

0 commit comments

Comments
 (0)