Skip to content

Commit c6c2efb

Browse files
templates: Add ipv6 variant that triggers azure singlestack
Refactor cluster_variant checking to be more robust.
1 parent 1800e21 commit c6c2efb

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,18 @@ objects:
393393
cp "$(command -v openshift-install)" /tmp
394394
mkdir /tmp/artifacts/installer
395395
396+
function has_variant() {
397+
regex="(^|,)$1($|,)"
398+
if [[ $CLUSTER_VARIANT =~ $regex ]]; then
399+
return 0
400+
fi
401+
return 1
402+
}
403+
396404
if [[ -n "${INSTALL_INITIAL_RELEASE}" && -n "${RELEASE_IMAGE_INITIAL}" ]]; then
397405
echo "Installing from initial release ${RELEASE_IMAGE_INITIAL}"
398406
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${RELEASE_IMAGE_INITIAL}"
399-
elif [[ "${CLUSTER_VARIANT}" =~ "mirror" ]]; then
407+
elif has_variant "mirror"; then
400408
export PATH=$PATH:/tmp # gain access to oc
401409
while [ ! command -V oc ]; do sleep 1; done # poll to make sure that the test container has dropped oc into the shared volume
402410
@@ -424,18 +432,18 @@ objects:
424432
cp "${SSH_PRIV_KEY_PATH}" ~/.ssh/
425433
426434
workers=3
427-
if [[ "${CLUSTER_VARIANT}" =~ "compact" ]]; then
435+
if has_variant "compact"; then
428436
workers=0
429437
fi
430438
if [[ "${CLUSTER_TYPE}" = "aws" ]]; then
431439
master_type=null
432-
if [[ "${CLUSTER_VARIANT}" =~ "xlarge" ]]; then
440+
if has_variant "xlarge"; then
433441
master_type=m5.8xlarge
434-
elif [[ "${CLUSTER_VARIANT}" =~ "large" ]]; then
442+
elif has_variant "large"; then
435443
master_type=m5.4xlarge
436444
fi
437445
subnets="[]"
438-
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
446+
if has_variant "shared-vpc"; then
439447
case $((RANDOM % 4)) in
440448
0) subnets="['subnet-030a88e6e97101ab2','subnet-0e07763243186cac5','subnet-02c5fea7482f804fb','subnet-0291499fd1718ee01','subnet-01c4667ad446c8337','subnet-025e9043c44114baa']";;
441449
1) subnets="['subnet-0170ee5ccdd7e7823','subnet-0d50cac95bebb5a6e','subnet-0094864467fc2e737','subnet-0daa3919d85296eb6','subnet-0ab1e11d3ed63cc97','subnet-07681ad7ce2b6c281']";;
@@ -498,7 +506,7 @@ objects:
498506
vnetname=""
499507
ctrlsubnet=""
500508
computesubnet=""
501-
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
509+
if has_variant "shared-vpc"; then
502510
vnetrg="os4-common"
503511
vnetname="do-not-delete-shared-vnet-${AZURE_REGION}"
504512
ctrlsubnet="subnet-1"
@@ -545,7 +553,7 @@ objects:
545553
network=""
546554
ctrlsubnet=""
547555
computesubnet=""
548-
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
556+
if has_variant "shared-vpc"; then
549557
network="do-not-delete-shared-network"
550558
ctrlsubnet="do-not-delete-shared-master-subnet"
551559
computesubnet="do-not-delete-shared-worker-subnet"
@@ -580,7 +588,7 @@ objects:
580588
581589
# as a current stop gap -- this is pointing to a proxy hosted in
582590
# the namespace "ci-test-ewolinet" on the ci cluster
583-
if [[ "${CLUSTER_VARIANT}" =~ "proxy" ]]; then
591+
if has_variant "proxy"; then
584592
585593
# FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1750650 we need to
586594
# use a http endpoint for the httpsProxy value
@@ -664,17 +672,31 @@ objects:
664672
fi
665673
666674
network_type="${CLUSTER_NETWORK_TYPE-}"
667-
if [[ "${CLUSTER_VARIANT}" =~ "ovn" ]]; then
675+
if has_variant "ovn"; then
668676
network_type=OVNKubernetes
669677
fi
670-
if [[ -n "${network_type}" ]]; then
678+
if has_variant "ipv6"; then
679+
export OPENSHIFT_INSTALL_AZURE_EMULATE_SINGLESTACK_IPV6=true
680+
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
681+
networking:
682+
networkType: OVNKubernetes
683+
machineNetwork:
684+
- cidr: 10.0.0.0/16
685+
- cidr: fd00::/48
686+
clusterNetwork:
687+
- cidr: fd01::/48
688+
hostPrefix: 64
689+
serviceNetwork:
690+
- fd02::/112
691+
EOF
692+
elif [[ -n "${network_type}" ]]; then
671693
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
672694
networking:
673695
networkType: ${network_type}
674696
EOF
675697
fi
676698
677-
if [[ "${CLUSTER_VARIANT}" =~ "mirror" ]]; then
699+
if has_variant "mirror"; then
678700
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
679701
imageContentSources:
680702
- source: "${MIRROR_BASE}-scratch"
@@ -683,7 +705,7 @@ objects:
683705
EOF
684706
fi
685707
686-
if [[ "${CLUSTER_VARIANT}" =~ "fips" ]]; then
708+
if has_variant "fips"; then
687709
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
688710
fips: true
689711
EOF

0 commit comments

Comments
 (0)