Skip to content

template: Use a more correct kill command #6223

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

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci-operator/templates/master-sidecar-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ objects:
set -euo pipefail

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

# wait until the master job creates admin.kubeconfig
while true; do
Expand Down Expand Up @@ -104,7 +104,7 @@ objects:
echo "Gathering artifacts ..."
}
trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

(
while true; do
Expand Down
2 changes: 1 addition & 1 deletion ci-operator/templates/master-sidecar-4.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ objects:
set -euo pipefail

trap 'touch /tmp/shared/exit' EXIT
trap 'jobs -p | xargs kill || true; exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

# wait until the master job creates admin.kubeconfig
while true; do
Expand Down
2 changes: 1 addition & 1 deletion ci-operator/templates/master-sidecar-4.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ objects:
set -euo pipefail

trap 'touch /tmp/shared/exit' EXIT
trap 'jobs -p | xargs kill || true; exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

# wait until the master job creates admin.kubeconfig
while true; do
Expand Down
2 changes: 1 addition & 1 deletion ci-operator/templates/master-sidecar-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ objects:
set -euo pipefail

trap 'touch /tmp/shared/exit' EXIT
trap 'jobs -p | xargs kill || true; exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

# wait until the master job creates admin.kubeconfig
while true; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ objects:

}

trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM
teardown

# Runs an install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/done' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ objects:
export PATH=/tmp/shared:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

function patch_image_specs() {
cat <<EOF >samples-patch.yaml
Expand Down Expand Up @@ -863,7 +863,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

function fips_check() {
oc --insecure-skip-tls-verify --request-timeout=60s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodelist
Expand Down Expand Up @@ -854,7 +854,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ objects:
#!/bin/bash
set -euo pipefail
trap 'touch "${HOME}"/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM
mock-nss.sh
gcloud auth activate-service-account \
--quiet --key-file /tmp/cluster/gce.json
Expand Down Expand Up @@ -326,7 +326,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /home/packer/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -628,7 +628,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ objects:
export PATH=/tmp/shared:/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -655,7 +655,7 @@ objects:
export CLUSTER_NAME=${CLUSTER_NAME: -14}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ objects:
export PATH=/tmp/shared:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -770,7 +770,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -2110,7 +2110,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ objects:
export PATH=/tmp/shared:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -1310,7 +1310,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cp "$(which oc)" /tmp/shared/

Expand Down Expand Up @@ -195,7 +195,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/shared/exit; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cd /usr/share/ansible/openshift-ansible/
mkdir -p test/ci/inventory/group_vars/OSEv3
Expand Down Expand Up @@ -314,7 +314,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ objects:
set -euo pipefail

trap 'touch /tmp/shared/prepared' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cp "$(which oc)" /tmp/shared/

Expand Down Expand Up @@ -181,7 +181,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cp "$(which oc)" /tmp/shared/

Expand Down Expand Up @@ -286,7 +286,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/exit; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

ansible-playbook -vv \
-e openshift_test_repo=${RPM_REPO_OPENSHIFT_ORIGIN} -e 'oreg_url=${IMAGE_FORMAT}' \
Expand Down Expand Up @@ -363,7 +363,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cp "$(which oc)" /tmp/shared/

Expand Down Expand Up @@ -190,7 +190,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/shared/exit; else touch /tmp/shared/install; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

ansible-playbook -vv \
-e openshift_test_repo="${PREVIOUS_RPM_REPO}" \
Expand Down Expand Up @@ -223,7 +223,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/shared/exit; else touch /tmp/shared/test; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

while true; do
if [[ ! -f /tmp/shared/install ]]; then
Expand Down Expand Up @@ -311,7 +311,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

cp "$(which oc)" /tmp/shared/

Expand Down Expand Up @@ -189,7 +189,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/exit; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

ansible-playbook -vv \
-e openshift_test_repo=${RPM_REPO_OPENSHIFT_ORIGIN} -e 'oreg_url=${IMAGE_FORMAT}' \
Expand Down Expand Up @@ -267,7 +267,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ objects:
export PATH=/tmp/shared:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -172,7 +172,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if [[ $rc -ne 0 ]]; then touch /tmp/exit; fi; exit $rc' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

ansible-playbook -vv \
-e openshift_test_repo=${RPM_REPO_OPENSHIFT_ORIGIN} -e 'oreg_url=${IMAGE_FORMAT}' \
Expand Down Expand Up @@ -250,7 +250,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in `seq 1 180`; do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ objects:
export PATH=/usr/libexec/origin:$PATH

trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

mkdir -p "${HOME}"

Expand Down Expand Up @@ -390,7 +390,7 @@ objects:
set -euo pipefail

trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/scaleup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

echo -n "Waiting for cluster setup..."

Expand Down Expand Up @@ -573,7 +573,7 @@ objects:
}

trap 'teardown' EXIT
trap 'kill $(jobs -p); exit 0' TERM
trap 'jobs -p | xargs -r kill; exit 0' TERM

for i in $(seq 1 220); do
if [[ -f /tmp/shared/exit ]]; then
Expand Down
Loading