diff --git a/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-commands.sh b/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-commands.sh index 08707341d325..42e5a74992db 100644 --- a/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-commands.sh +++ b/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-commands.sh @@ -4,11 +4,21 @@ set -o nounset set -o errexit set -o pipefail +trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM + cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile export AWS_SHARED_CREDENTIALS_FILE=$cluster_profile/.awscred export AZURE_AUTH_LOCATION=$cluster_profile/osServicePrincipal.json echo "Deprovisioning cluster ..." cp -ar "${SHARED_DIR}" /tmp/installer -openshift-install --dir /tmp/installer destroy cluster -cp /tmp/installer/.openshift_install.log "${ARTIFACT_DIR}/" +openshift-install --dir /tmp/installer destroy cluster & + +set +e +wait "$!" +ret="$?" +set -e + +cp /tmp/installer/.openshift_install.log "${ARTIFACT_DIR}" + +exit "$ret" diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh index 91af498fda83..f81112bb0cc3 100755 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-commands.sh @@ -39,13 +39,13 @@ TF_LOG=debug openshift-install --dir="${dir}" create cluster 2>&1 | grep --line- set +e wait "$!" -ret=$? +ret="$?" set -e +sed 's/password: .*/password: REDACTED/' "${dir}/.openshift_install.log" >"${ARTIFACT_DIR}/.openshift_install.log" +cp "${dir}"/log-bundle-*.tar.gz "${ARTIFACT_DIR}/" 2>/dev/null || : cp \ -t "${SHARED_DIR}" \ "${dir}/auth/kubeconfig" \ "${dir}/metadata.json" -cp "${dir}/.openshift_install.log" "${ARTIFACT_DIR}/" -cp "${dir}"/log-bundle-*.tar.gz "${ARTIFACT_DIR}/" 2>/dev/null || : exit "$ret"