diff --git a/ci-operator/templates/openshift/endurance/endurance-install.yaml b/ci-operator/templates/openshift/endurance/endurance-install.yaml index 629207e218d4a..e2a02882569b8 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 ec98918777330..4542460a257b7 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 10d85285eb448..5723572d9c8cc 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 2d076bf013606..9f268a0ab9d7a 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 a011906847840..4560c310ba05b 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 867cf8f8e6990..68c5720ad75dc 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 ec4f6cdf6eb79..4b6c45d3e3672 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 1e934f673c9ea..c30451c4f3e5a 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 1d3f804da1b01..bbe0c53abc999 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 af52259a13e0a..cf61001e54aec 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 5a282787b3779..973a2ce07abb7 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 e724d58789a50..a34616f00e66a 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 500cc61e95583..7fb5a9848ed68 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 9f0ec6e0d8b1e..33a3ceb71c341 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 852a19ec7d7b8..10309cc461502 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 b01ca0a66c648..ab50965035f35 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 63e6cffc0be8e..da782e9d5d8c9 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() {