From ca655477ca120dd13e486f033b5aeed000f0f0f1 Mon Sep 17 00:00:00 2001 From: Ben Parees Date: Fri, 17 Jan 2020 09:48:11 -0500 Subject: [PATCH] Revert "Revert "add -eou pipefail to remaining job templates"" This reverts commit 07bd61d6777aa85e686df3c4593051a339ce9440. --- .../templates/openshift/endurance/endurance-install.yaml | 9 ++++++--- .../cluster-launch-installer-custom-test-image.yaml | 6 ++++-- .../installer/cluster-launch-installer-e2e.yaml | 4 +++- .../installer/cluster-launch-installer-libvirt-e2e.yaml | 3 ++- .../installer/cluster-launch-installer-metal-e2e.yaml | 8 ++++++-- .../cluster-launch-installer-openstack-e2e.yaml | 2 ++ .../installer/cluster-launch-installer-ovirt-e2e.yaml | 6 +++++- .../installer/cluster-launch-installer-src.yaml | 4 +++- .../installer/cluster-launch-installer-upi-e2e.yaml | 4 +++- .../installer/cluster-launch-installer-upi-src.yaml | 6 ++++-- .../cluster-launch-e2e-openshift-ansible.yaml | 2 ++ .../cluster-launch-e2e-openshift-jenkins.yaml | 2 ++ .../openshift-ansible/cluster-launch-e2e-upgrade.yaml | 2 ++ .../openshift/openshift-ansible/cluster-launch-e2e.yaml | 2 ++ .../openshift/openshift-ansible/cluster-launch-src.yaml | 2 ++ .../openshift-ansible/cluster-scaleup-e2e-40.yaml | 6 +++++- .../openshift-azure/cluster-launch-e2e-azure.yaml | 4 ++-- 17 files changed, 55 insertions(+), 17 deletions(-) diff --git a/ci-operator/templates/openshift/endurance/endurance-install.yaml b/ci-operator/templates/openshift/endurance/endurance-install.yaml index 629207e218d4..e2a02882569b 100644 --- a/ci-operator/templates/openshift/endurance/endurance-install.yaml +++ b/ci-operator/templates/openshift/endurance/endurance-install.yaml @@ -80,7 +80,8 @@ objects: - /bin/bash - -c - | - #!/bin/bash -x + #!/bin/bash + set -euo pipefail # fetch the oc binary so we can talk to the cluster. export PATH=$PATH:/tmp/shared/bin @@ -153,7 +154,8 @@ objects: - /bin/bash - -c - | - #!/bin/bash -x + #!/bin/bash + set -euo pipefail export PATH=$PATH:/tmp/shared/bin @@ -377,7 +379,8 @@ objects: - /bin/sh - -c - | - #!/bin/sh -x + #!/bin/bash + set -euo pipefail export PATH=$PATH:/tmp/shared/bin diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-custom-test-image.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-custom-test-image.yaml index ec9891877733..4542460a257b 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-custom-test-image.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-custom-test-image.yaml @@ -380,8 +380,8 @@ objects: - /bin/bash - -c - | - #!/bin/sh - set -e + #!/bin/bash + set -euo pipefail trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM @@ -660,6 +660,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml index 10d85285eb44..5723572d9c8c 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml @@ -385,7 +385,7 @@ objects: - /bin/bash - -c - | - #!/bin/sh + #!/bin/bash set -euo pipefail trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT @@ -731,6 +731,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-libvirt-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-libvirt-e2e.yaml index 2d076bf01360..9f268a0ab9d7 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-libvirt-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-libvirt-e2e.yaml @@ -185,8 +185,9 @@ objects: - /bin/sh - -c - | - #!/bin/sh + #!/bin/bash set -euo pipefail + trap 'rc=$?; if test "${rc}" -eq 0; then touch "${HOME}"/setup-success; else touch "${HOME}"/exit; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM cat > "${HOME}"/run-tests.sh << 'EOF' diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml index a01190684784..4560c310ba05 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-metal-e2e.yaml @@ -226,8 +226,10 @@ objects: - /bin/sh - -c - | - #!/bin/sh - set -ex + #!/bin/bash + set -euo pipefail + set -x + trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM @@ -515,6 +517,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-openstack-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-openstack-e2e.yaml index 867cf8f8e699..68c5720ad75d 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-openstack-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-openstack-e2e.yaml @@ -445,6 +445,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-ovirt-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-ovirt-e2e.yaml index ec4f6cdf6eb7..4b6c45d3e367 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-ovirt-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-ovirt-e2e.yaml @@ -323,7 +323,9 @@ objects: - /bin/sh - -c - | - #!/bin/sh + #!/bin/bash + set -euo pipefail + 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 # Wait untill lease is acquired @@ -449,6 +451,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml index 1e934f673c9e..c30451c4f3e5 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml @@ -243,7 +243,7 @@ objects: - /bin/bash - -c - | - #!/bin/sh + #!/bin/bash set -euo pipefail trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT @@ -566,6 +566,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml index 1d3f804da1b0..bbe0c53abc99 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml @@ -338,8 +338,9 @@ objects: - /bin/sh - -c - | - #!/bin/sh + #!/bin/bash set -euo pipefail + trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM @@ -1855,6 +1856,7 @@ objects: - -c - | #!/bin/bash + set -euo pipefail function queue() { local TARGET="${1}" diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml index af52259a13e0..cf61001e54ae 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-src.yaml @@ -333,8 +333,9 @@ objects: - /bin/sh - -c - | - #!/bin/sh - set -e + #!/bin/bash + set -euo pipefail + trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM @@ -1073,6 +1074,7 @@ objects: - -c - | #!/bin/bash + set -euo pipefail function queue() { local TARGET="${1}" diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-ansible.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-ansible.yaml index 5a282787b377..973a2ce07abb 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-ansible.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-ansible.yaml @@ -255,6 +255,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function teardown() { set +e touch /tmp/shared/exit diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-jenkins.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-jenkins.yaml index e724d58789a5..a34616f00e66 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-jenkins.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-openshift-jenkins.yaml @@ -312,6 +312,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function teardown() { set +e touch /tmp/shared/exit diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-upgrade.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-upgrade.yaml index 500cc61e9558..7fb5a9848ed6 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-upgrade.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-upgrade.yaml @@ -260,6 +260,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function teardown() { set +e touch /tmp/shared/exit diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e.yaml index 9f0ec6e0d8b1..33a3ceb71c34 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e.yaml @@ -216,6 +216,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function teardown() { set +e touch /tmp/shared/exit diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-src.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-src.yaml index 852a19ec7d7b..10309cc46150 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-src.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-src.yaml @@ -199,6 +199,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function teardown() { set +e touch /tmp/shared/exit diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml index b01ca0a66c64..ab50965035f3 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml @@ -224,7 +224,9 @@ objects: - /bin/sh - -c - | - #!/bin/sh + #!/bin/bash + set -euo pipefail + trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit /tmp/setup-failed; fi; exit "${rc}"' EXIT trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM cp "$(command -v openshift-install)" /tmp @@ -362,6 +364,8 @@ objects: - -c - | #!/bin/bash + set -euo pipefail + function queue() { local TARGET="${1}" shift diff --git a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml index 63e6cffc0be8..da782e9d5d8c 100644 --- a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml +++ b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure.yaml @@ -158,7 +158,6 @@ objects: - -c - | #!/bin/bash - # error handling and sync code set -euo pipefail trap 'touch /tmp/shared/exit' EXIT @@ -271,7 +270,7 @@ objects: - /bin/bash - -c - | - #!/bin/bash + #!/bin/bash set -euo pipefail trap 'rc=$?; if [[ $rc -ne 0 ]]; then @@ -361,6 +360,7 @@ objects: - -c - | #!/bin/bash + set -euo pipefail # teardown is collecting debug data and deleting all used resources function teardown() {