Skip to content

Commit

Permalink
cluster-launch-installer-e2e: Restore EXIT and TERM signal handlers
Browse files Browse the repository at this point in the history
I'd removed these in 3f2f01c
(ci-operator/config/openshift/installer/master: Move to
openshift-install, 2018-09-26, #1677) while removing the shell from
the setup container.  But we got a shell back in b20d571
(cluster-launch-installer-e2e: Start setting expirationDate again,
2018-09-29, #1761), and restoring these handlers will help:

* Trigger early pod wrap-up when the setup container dies.  Both the
  test and teardown containers are monitoring the 'exit' file so they
  can bail early.

* Forward TERM to the installer, so we can exit gracefully when
  someone TERMs the shell script.

For the signal handling to work, we need to keep the shell process
around, so I've dropped the 'exec' from the openshift-install
invocation and moved it to the background instead (so 'jobs -p' will
list it).
  • Loading branch information
wking committed Oct 17, 2018
1 parent f541bc0 commit d862f6f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,12 @@ objects:
- -c
- |
#!/bin/sh
trap 'rc=$?; if test "${rc}" -ne 0; then touch /tmp/exit; fi; exit "${rc}"' EXIT
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN}; fi' TERM
export _CI_ONLY_STAY_AWAY_OPENSHIFT_INSTALL_AWS_USER_TAGS="{\"expirationDate\": \"$(date -d '4 hours' --iso=minutes --utc)\"}"
exec /bin/openshift-install --dir=/tmp/artifacts/installer --log-level=debug cluster
/bin/openshift-install --dir=/tmp/artifacts/installer --log-level=debug cluster &
wait
# Performs cleanup of all created resources
- name: teardown
Expand Down

0 comments on commit d862f6f

Please sign in to comment.