Skip to content

Commit

Permalink
templates: Add ipv6 variant that triggers azure singlestack
Browse files Browse the repository at this point in the history
Refactor cluster_variant checking to be more robust.
  • Loading branch information
smarterclayton committed Jan 22, 2020
1 parent 1800e21 commit c6c2efb
Showing 1 changed file with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,18 @@ objects:
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer
function has_variant() {
regex="(^|,)$1($|,)"
if [[ $CLUSTER_VARIANT =~ $regex ]]; then
return 0
fi
return 1
}
if [[ -n "${INSTALL_INITIAL_RELEASE}" && -n "${RELEASE_IMAGE_INITIAL}" ]]; then
echo "Installing from initial release ${RELEASE_IMAGE_INITIAL}"
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${RELEASE_IMAGE_INITIAL}"
elif [[ "${CLUSTER_VARIANT}" =~ "mirror" ]]; then
elif has_variant "mirror"; then
export PATH=$PATH:/tmp # gain access to oc
while [ ! command -V oc ]; do sleep 1; done # poll to make sure that the test container has dropped oc into the shared volume
Expand Down Expand Up @@ -424,18 +432,18 @@ objects:
cp "${SSH_PRIV_KEY_PATH}" ~/.ssh/
workers=3
if [[ "${CLUSTER_VARIANT}" =~ "compact" ]]; then
if has_variant "compact"; then
workers=0
fi
if [[ "${CLUSTER_TYPE}" = "aws" ]]; then
master_type=null
if [[ "${CLUSTER_VARIANT}" =~ "xlarge" ]]; then
if has_variant "xlarge"; then
master_type=m5.8xlarge
elif [[ "${CLUSTER_VARIANT}" =~ "large" ]]; then
elif has_variant "large"; then
master_type=m5.4xlarge
fi
subnets="[]"
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
if has_variant "shared-vpc"; then
case $((RANDOM % 4)) in
0) subnets="['subnet-030a88e6e97101ab2','subnet-0e07763243186cac5','subnet-02c5fea7482f804fb','subnet-0291499fd1718ee01','subnet-01c4667ad446c8337','subnet-025e9043c44114baa']";;
1) subnets="['subnet-0170ee5ccdd7e7823','subnet-0d50cac95bebb5a6e','subnet-0094864467fc2e737','subnet-0daa3919d85296eb6','subnet-0ab1e11d3ed63cc97','subnet-07681ad7ce2b6c281']";;
Expand Down Expand Up @@ -498,7 +506,7 @@ objects:
vnetname=""
ctrlsubnet=""
computesubnet=""
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
if has_variant "shared-vpc"; then
vnetrg="os4-common"
vnetname="do-not-delete-shared-vnet-${AZURE_REGION}"
ctrlsubnet="subnet-1"
Expand Down Expand Up @@ -545,7 +553,7 @@ objects:
network=""
ctrlsubnet=""
computesubnet=""
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
if has_variant "shared-vpc"; then
network="do-not-delete-shared-network"
ctrlsubnet="do-not-delete-shared-master-subnet"
computesubnet="do-not-delete-shared-worker-subnet"
Expand Down Expand Up @@ -580,7 +588,7 @@ objects:
# as a current stop gap -- this is pointing to a proxy hosted in
# the namespace "ci-test-ewolinet" on the ci cluster
if [[ "${CLUSTER_VARIANT}" =~ "proxy" ]]; then
if has_variant "proxy"; then
# FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1750650 we need to
# use a http endpoint for the httpsProxy value
Expand Down Expand Up @@ -664,17 +672,31 @@ objects:
fi
network_type="${CLUSTER_NETWORK_TYPE-}"
if [[ "${CLUSTER_VARIANT}" =~ "ovn" ]]; then
if has_variant "ovn"; then
network_type=OVNKubernetes
fi
if [[ -n "${network_type}" ]]; then
if has_variant "ipv6"; then
export OPENSHIFT_INSTALL_AZURE_EMULATE_SINGLESTACK_IPV6=true
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
networking:
networkType: OVNKubernetes
machineNetwork:
- cidr: 10.0.0.0/16
- cidr: fd00::/48
clusterNetwork:
- cidr: fd01::/48
hostPrefix: 64
serviceNetwork:
- fd02::/112
EOF
elif [[ -n "${network_type}" ]]; then
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
networking:
networkType: ${network_type}
EOF
fi
if [[ "${CLUSTER_VARIANT}" =~ "mirror" ]]; then
if has_variant "mirror"; then
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
imageContentSources:
- source: "${MIRROR_BASE}-scratch"
Expand All @@ -683,7 +705,7 @@ objects:
EOF
fi
if [[ "${CLUSTER_VARIANT}" =~ "fips" ]]; then
if has_variant "fips"; then
cat >> /tmp/artifacts/installer/install-config.yaml << EOF
fips: true
EOF
Expand Down

0 comments on commit c6c2efb

Please sign in to comment.