-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e: Gather on bootstrap failure #4734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -340,6 +340,8 @@ objects: | |
| value: ${BASE_DOMAIN} | ||
| - name: SSH_PUB_KEY_PATH | ||
| value: /etc/openshift-installer/ssh-publickey | ||
| - name: SSH_PRIVATE_KEY_PATH | ||
| value: /etc/openshift-installer/ssh-privatekey | ||
| - name: PULL_SECRET_PATH | ||
| value: /etc/openshift-installer/pull-secret | ||
| - name: TFVARS_PATH | ||
|
|
@@ -363,6 +365,15 @@ objects: | |
| trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT | ||
| trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM | ||
|
|
||
| GATHER_BOOTSTRAP_ARGS= | ||
|
|
||
| function gather_bootstrap_and_fail() { | ||
| if test -n "${GATHER_BOOTSTRAP_ARGS}"; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not pass argument to the function?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could. But we need a variable to gather these as you add a bootstrap machine and control planes machines. So inheritance seemed like a convenient way to pass them in. I can pass them explicitly if you prefer. |
||
| openshift-install --dir=/tmp/artifacts/installer gather bootstrap --key "${SSH_PRIVATE_KEY_PATH}" ${GATHER_BOOTSTRAP_ARGS} | ||
| fi | ||
| return 1 | ||
| } | ||
|
|
||
| while true; do | ||
| if [[ -f /tmp/exit ]]; then | ||
| echo "Another process exited" 2>&1 | ||
|
|
@@ -591,6 +602,7 @@ objects: | |
|
|
||
| BOOTSTRAP_IP="$(aws cloudformation describe-stacks --stack-name "${CLUSTER_NAME}-bootstrap" \ | ||
| --query 'Stacks[].Outputs[?OutputKey == `BootstrapPublicIp`].OutputValue' --output text)" | ||
| GATHER_BOOTSTRAP_ARGS="${GATHER_BOOTSTRAP_ARGS} --bootstrap ${BOOTSTRAP_IP}" | ||
|
|
||
| aws cloudformation create-stack \ | ||
| --stack-name "${CLUSTER_NAME}-control-plane" \ | ||
|
|
@@ -622,6 +634,7 @@ objects: | |
| CONTROL_PLANE_0_IP="$(echo "${CONTROL_PLANE_IPS}" | cut -d, -f1)" | ||
| CONTROL_PLANE_1_IP="$(echo "${CONTROL_PLANE_IPS}" | cut -d, -f2)" | ||
| CONTROL_PLANE_2_IP="$(echo "${CONTROL_PLANE_IPS}" | cut -d, -f3)" | ||
| GATHER_BOOTSTRAP_ARGS="${GATHER_BOOTSTRAP_ARGS} --master ${CONTROL_PLANE_0_IP} --master ${CONTROL_PLANE_1_IP} --master ${CONTROL_PLANE_2_IP}" | ||
|
|
||
| for INDEX in 0 1 2 | ||
| do | ||
|
|
@@ -708,7 +721,7 @@ objects: | |
|
|
||
| echo "Waiting for bootstrap to complete" | ||
| openshift-install --dir=/tmp/artifacts/installer wait-for bootstrap-complete & | ||
| wait "$!" | ||
| wait "$!" || gather_bootstrap_and_fail | ||
|
|
||
| echo "Bootstrap complete, destroying bootstrap resources" | ||
| if [[ "${CLUSTER_TYPE}" == "aws" ]]; then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why gather and fail. I don't think it's a great collection..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only gather when installation fails. By failing in the function regardless of gather success, I don't need to figure out how
a || b || cgroups in shell ;)