Skip to content

Commit 43e08e7

Browse files
committed
ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e: Push AWS-specific default base domain down into the template
We want to set per-platform defaults to make life easier for folks consuming these templates. := is in POSIX [1]. The new lowercase form is because ${BASE_DOMAIN} expansion is happening at the Go-template level, so attempting to do: echo "Base domain: ${BASE_DOMAIN:=origin-ci-int-aws.dev.rhcloud.com}" echo "FIXME: testing BASE_DOMAIN: ${BASE_DOMAIN}" results in [2]: Base domain: origin-ci-int-aws.dev.rhcloud.com FIXME: testing BASE_DOMAIN: It is a bit strange to have vSphere using a domain that includes "aws", but it seems to work [3]: $ curl -s https://storage.googleapis.com/origin-ci-test/logs/canary-openshift-ocp-installer-e2e-vsphere-upi-4.2/180/artifacts/e2e-vsphere-upi/installer/.openshift_install.log | grep aws | head -n1 time="2019-09-23T17:21:17Z" level=info msg="Waiting up to 30m0s for the Kubernetes API at https://api.ci-op-4jhq8mjx-f1a95.origin-ci-int-aws.dev.rhcloud.com:6443..." Clayton says this is because we're currently running our vSphere CI on AWS, which makes sense. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 [2]: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/openshift_release/5151/rehearse-5151-pull-ci-openshift-installer-master-e2e-aws-upi/4 [3]: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/logs/canary-openshift-ocp-installer-e2e-vsphere-upi-4.2/180
1 parent 62658be commit 43e08e7

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ parameters:
1919
- name: RELEASE_IMAGE_LATEST
2020
required: true
2121
- name: BASE_DOMAIN
22-
value: origin-ci-int-aws.dev.rhcloud.com
23-
required: true
2422
- name: BUILD_ID
2523
required: false
2624

@@ -402,10 +400,12 @@ objects:
402400
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
403401
404402
if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
403+
base_domain="${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}"
404+
echo "FIXME: Base domain: '${base_domain}"
405405
MACHINE_CIDR=10.0.0.0/16
406406
cat > /tmp/artifacts/installer/install-config.yaml << EOF
407407
apiVersion: v1
408-
baseDomain: ${BASE_DOMAIN}
408+
baseDomain: ${base_domain}
409409
metadata:
410410
name: ${CLUSTER_NAME}
411411
controlPlane:
@@ -442,12 +442,13 @@ objects:
442442
openshift-install --dir=/tmp/artifacts/installer create manifests
443443
rm -f /tmp/artifacts/installer/openshift/99_openshift-cluster-api_master-machines-*.yaml /tmp/artifacts/installer/openshift/99_openshift-cluster-api_worker-machinesets-*.yaml
444444
elif [[ "${CLUSTER_TYPE}" == "vsphere" ]]; then
445+
base_domain="${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}"
445446
# Get user and password from TFVARS_PATH
446447
export VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH})
447448
export VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH})
448449
cat > /tmp/artifacts/installer/install-config.yaml << EOF
449450
apiVersion: v1beta4
450-
baseDomain: ${BASE_DOMAIN}
451+
baseDomain: ${base_domain}
451452
metadata:
452453
name: ${CLUSTER_NAME}
453454
networking:
@@ -507,8 +508,8 @@ objects:
507508
IGNITION_CA="$(jq '.ignition.security.tls.certificateAuthorities[0].source' /tmp/artifacts/installer/master.ign)" # explicitly keeping wrapping quotes
508509
509510
HOSTED_ZONE="$(aws route53 list-hosted-zones-by-name \
510-
--dns-name "${BASE_DOMAIN}" \
511-
--query "HostedZones[? Config.PrivateZone != \`true\` && Name == \`${BASE_DOMAIN}.\`].Id" \
511+
--dns-name "${base_domain}" \
512+
--query "HostedZones[? Config.PrivateZone != \`true\` && Name == \`${base_domain}.\`].Id" \
512513
--output text)"
513514
514515
aws cloudformation create-stack --stack-name "${CLUSTER_NAME}-vpc" \
@@ -539,7 +540,7 @@ objects:
539540
ParameterKey=ClusterName,ParameterValue="${CLUSTER_NAME}" \
540541
ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \
541542
ParameterKey=HostedZoneId,ParameterValue="${HOSTED_ZONE}" \
542-
ParameterKey=HostedZoneName,ParameterValue="${BASE_DOMAIN}" \
543+
ParameterKey=HostedZoneName,ParameterValue="${base_domain}" \
543544
ParameterKey=VpcId,ParameterValue="${VPC_ID}" \
544545
ParameterKey=PrivateSubnets,ParameterValue="${PRIVATE_SUBNETS}" \
545546
ParameterKey=PublicSubnets,ParameterValue="${PUBLIC_SUBNETS}" &
@@ -612,12 +613,12 @@ objects:
612613
ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \
613614
ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \
614615
ParameterKey=PrivateHostedZoneId,ParameterValue="${PRIVATE_HOSTED_ZONE}" \
615-
ParameterKey=PrivateHostedZoneName,ParameterValue="${CLUSTER_NAME}.${BASE_DOMAIN}" \
616+
ParameterKey=PrivateHostedZoneName,ParameterValue="${CLUSTER_NAME}.${base_domain}" \
616617
ParameterKey=Master0Subnet,ParameterValue="${PRIVATE_SUBNET_0}" \
617618
ParameterKey=Master1Subnet,ParameterValue="${PRIVATE_SUBNET_1}" \
618619
ParameterKey=Master2Subnet,ParameterValue="${PRIVATE_SUBNET_2}" \
619620
ParameterKey=MasterSecurityGroupId,ParameterValue="${MASTER_SECURITY_GROUP}" \
620-
ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${BASE_DOMAIN}:22623/config/master" \
621+
ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/master" \
621622
ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \
622623
ParameterKey=MasterInstanceProfileName,ParameterValue="${MASTER_INSTANCE_PROFILE}" \
623624
ParameterKey=RegisterNlbIpTargetsLambdaArn,ParameterValue="${NLB_IP_TARGETS_LAMBDA}" \
@@ -648,7 +649,7 @@ objects:
648649
ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \
649650
ParameterKey=Subnet,ParameterValue="${!SUBNET}" \
650651
ParameterKey=WorkerSecurityGroupId,ParameterValue="${WORKER_SECURITY_GROUP}" \
651-
ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${BASE_DOMAIN}:22623/config/worker" \
652+
ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/worker" \
652653
ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \
653654
ParameterKey=WorkerInstanceType,ParameterValue=m4.xlarge \
654655
ParameterKey=WorkerInstanceProfileName,ParameterValue="${WORKER_INSTANCE_PROFILE}" &
@@ -690,9 +691,9 @@ objects:
690691
691692
cluster_id = "${CLUSTER_NAME}"
692693
693-
base_domain = "${BASE_DOMAIN}"
694+
base_domain = "${base_domain}"
694695
695-
cluster_domain = "${CLUSTER_NAME}.${BASE_DOMAIN}"
696+
cluster_domain = "${CLUSTER_NAME}.${base_domain}"
696697
697698
bootstrap_ignition_url = "${BOOTSTRAP_URI}"
698699

0 commit comments

Comments
 (0)