Skip to content

Commit 98857c4

Browse files
committed
ci-operator/step-registry/ipi/conf/aws: Get region from Boskos lease
Like 7aa198b (ci-operator/step-registry/ipi/conf/azure: Get region from Boskos lease, 2020-10-14, openshift#12584), but for AWS. 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. I'm leaving ci-operator/templates alone; hopefully those will be gone soon. I've already updated ci-tools with openshift/ci-tools@00ebab17e1 (pkg/steps/clusterinstall/template: Get region from Boskos lease, 2020-12-11, openshift/ci-tools#1527). I'm also normalizing to uppercase shell variables, now that we are no longer constrained by Go template expansion. Hmm, at least that's why I thought the variables used to be lowercase, see 43e08e7 (ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e: Push AWS-specific default base domain down into the template, 2019-09-23, openshift#5151). But looking at the templates when de3de20 (step-registry: add configure and install IPI steps, 2020-01-14, openshift#6708), I'm now not sure why these step commands were using lowercase variable names.
1 parent 4c4b5f0 commit 98857c4

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ CONFIG="${SHARED_DIR}/install-config.yaml"
88

99
expiration_date=$(date -d '4 hours' --iso=minutes --utc)
1010

11-
case "$((RANDOM % 4))" in
12-
0) aws_region=us-east-1
13-
zone_1=us-east-1b
14-
zone_2=us-east-1c;;
15-
1) aws_region=us-east-2;;
16-
2) aws_region=us-west-1;;
17-
3) aws_region=us-west-2;;
18-
*) echo >&2 "invalid AWS region index"; exit 1;;
11+
REGION="${LEASED_RESOURCE}"
12+
case "${REGION}" in
13+
us-east-1)
14+
ZONE_1=us-east-1b
15+
ZONE_2=us-east-1c;;
1916
esac
20-
echo "AWS region: ${aws_region} (zones: ${zone_1:-${aws_region}a} ${zone_2:-${aws_region}b})"
17+
echo "AWS region: ${REGION} (zones: ${ZONE_1:-${REGION}a} ${ZONE_2:-${REGION}b})"
2118

2219
cat >> "${CONFIG}" << EOF
2320
baseDomain: origin-ci-int-aws.dev.rhcloud.com
@@ -26,19 +23,19 @@ controlPlane:
2623
platform:
2724
aws:
2825
zones:
29-
- ${zone_1:-${aws_region}a}
30-
- ${zone_2:-${aws_region}b}
26+
- ${ZONE1:-${REGION}a}
27+
- ${ZONE2:-${REGION}b}
3128
compute:
3229
- name: worker
3330
platform:
3431
aws:
3532
type: ${COMPUTE_NODE_TYPE}
3633
zones:
37-
- ${zone_1:-${aws_region}a}
38-
- ${zone_2:-${aws_region}b}
34+
- ${ZONE1:-${REGION}a}
35+
- ${ZONE2:-${REGION}b}
3936
platform:
4037
aws:
41-
region: ${aws_region}
38+
region: ${REGION}
4239
userTags:
4340
expirationDate: ${expiration_date}
4441
EOF

0 commit comments

Comments
 (0)