From 2e24ffa5f5981fdb3b2c138e826278da0fc44cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Barcarol=20Guimar=C3=A3es?= Date: Mon, 16 Dec 2019 18:01:49 +0000 Subject: [PATCH 1/5] step-registry: s/errext/errexit/ --- .../bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh | 2 +- .../ipi-deprovision-artifacts-must-gather-commands.sh | 4 ++-- .../deprovision/ipi-deprovision-deprovision-commands.sh | 4 ++-- .../ipi/install/install/ipi-install-install-commands.sh | 4 ++-- .../ipi/install/rbac/ipi-install-rbac-commands.sh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh index cec61d2ac4011..f92a5fb174bfa 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o nounset -set -o errext +set -o errexit set -o pipefail export PATH=$PATH:/tmp/shared diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-commands.sh b/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-commands.sh index 90c475270eeb6..629704c015c72 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-commands.sh +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-commands.sh @@ -1,9 +1,9 @@ #!/bin/bash set -o nounset -set -o errext +set -o errexit set -o pipefail echo "Running must-gather..." mkdir -p ${ARTIFACT_DIR}/must-gather -oc --insecure-skip-tls-verify adm must-gather --dest-dir ${ARTIFACT_DIR}/must-gather > ${ARTIFACT_DIR}/must-gather/must-gather.log \ No newline at end of file +oc --insecure-skip-tls-verify adm must-gather --dest-dir ${ARTIFACT_DIR}/must-gather > ${ARTIFACT_DIR}/must-gather/must-gather.log 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 1e439ba907edf..f51218ba9e016 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 @@ -1,8 +1,8 @@ #!/bin/bash set -o nounset -set -o errext +set -o errexit set -o pipefail echo "Deprovisioning cluster ..." -openshift-install --dir ${ARTIFACT_DIR}/installer destroy cluster \ No newline at end of file +openshift-install --dir ${ARTIFACT_DIR}/installer destroy cluster 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 e8e02aa154bea..b1df15f453c86 100644 --- 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 @@ -1,7 +1,7 @@ #!/bin/bash set -o nounset -set -o errext +set -o errexit set -o pipefail -# TODO(skuznets): oh boy \ No newline at end of file +# TODO(skuznets): oh boy diff --git a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh index 89d7bf072efe5..bb0479cf0143f 100644 --- a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh +++ b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o nounset -set -o errext +set -o errexit set -o pipefail # We want the cluster to be able to access these images From 18427d19b17c175011c0e11aebd4fe951c55c38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Barcarol=20Guimar=C3=A3es?= Date: Mon, 16 Dec 2019 18:02:07 +0000 Subject: [PATCH 2/5] step-registry: set role namespace, remove cat --- .../ipi/install/rbac/ipi-install-rbac-commands.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh index bb0479cf0143f..c98a999c967fc 100644 --- a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh +++ b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-commands.sh @@ -12,7 +12,7 @@ oc adm policy add-role-to-group system:image-puller system:authenticated --nam oc adm policy add-role-to-user admin system:serviceaccount:ci:ci-chat-bot --namespace "${NAMESPACE}" # Role for giving the e2e pod permissions to update imagestreams -cat < Date: Mon, 16 Dec 2019 20:41:52 +0000 Subject: [PATCH 3/5] step-registry: fix check for undefined variable --- .../artifacts/ipi-deprovision-artifacts-artifacts-commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-commands.sh b/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-commands.sh index dfb7b7487a6a7..936d1652b8b50 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-commands.sh +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-commands.sh @@ -9,7 +9,7 @@ function queue() { LIVE="$(jobs | wc -l)" done echo "${@}" - if [[ -n "${FILTER}" ]]; then + if [[ -n "${FILTER:-}" ]]; then "${@}" | "${FILTER}" >"${TARGET}" & else "${@}" >"${TARGET}" & From 98e1cdf6bf483765097b31d6f987f8af3da6cee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Barcarol=20Guimar=C3=A3es?= Date: Mon, 16 Dec 2019 18:13:47 +0000 Subject: [PATCH 4/5] step-registry: reference images from `stable` --- .../artifacts/ipi-deprovision-artifacts-artifacts-ref.yaml | 2 +- .../bootstrap/ipi-deprovision-artifacts-bootstrap-ref.yaml | 2 +- .../must-gather/ipi-deprovision-artifacts-must-gather-ref.yaml | 2 +- .../deprovision/ipi-deprovision-deprovision-ref.yaml | 2 +- .../ipi/install/install/ipi-install-install-ref.yaml | 2 +- .../step-registry/ipi/install/rbac/ipi-install-rbac-ref.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-ref.yaml b/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-ref.yaml index f35b4219df67f..dbba2b36b1b90 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-ref.yaml +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/artifacts/ipi-deprovision-artifacts-artifacts-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-deprovision-artifacts-artifacts - from: cli + from: stable:cli commands: ipi-deprovision-artifacts-artifacts-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-ref.yaml b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-ref.yaml index 762c8ef2b2806..6c7d30e83eb67 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-ref.yaml +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-deprovision-artifacts-bootstrap - from: "TODO(skuznets): need an image with ssh+jq+curl" + from: stable:cli # TODO(skuznets): need an image with ssh+jq+curl commands: ipi-deprovision-artifacts-bootstrap-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-ref.yaml b/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-ref.yaml index 0da82a5ea36dc..04dbcc5654b74 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-ref.yaml +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/must-gather/ipi-deprovision-artifacts-must-gather-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-deprovision-artifacts-must-gather - from: cli + from: stable:cli commands: ipi-deprovision-artifacts-must-gather-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-ref.yaml b/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-ref.yaml index fee07c15bfce4..55fb9bce959aa 100644 --- a/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-ref.yaml +++ b/ci-operator/step-registry/ipi/deprovision/deprovision/ipi-deprovision-deprovision-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-deprovision-deprovision - from: installer + from: stable:installer commands: ipi-deprovision-deprovision-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml index 8080c1e134ad6..094e79bdf4881 100644 --- a/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml +++ b/ci-operator/step-registry/ipi/install/install/ipi-install-install-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-install-install - from: installer + from: stable:installer commands: ipi-install-install-commands.sh resources: requests: diff --git a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-ref.yaml b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-ref.yaml index 2ee9209b4357a..1f2488352f984 100644 --- a/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-ref.yaml +++ b/ci-operator/step-registry/ipi/install/rbac/ipi-install-rbac-ref.yaml @@ -1,6 +1,6 @@ ref: as: ipi-install-rbac - from: cli + from: stable:cli commands: ipi-install-rbac-commands.sh resources: requests: From f981c57782fe1e05282e3f662fafcfcc84b5e0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Barcarol=20Guimar=C3=A3es?= Date: Mon, 16 Dec 2019 18:17:55 +0000 Subject: [PATCH 5/5] step-registry: access shared directory --- .../bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh | 4 +--- .../deprovision/ipi-deprovision-deprovision-commands.sh | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh index f92a5fb174bfa..13566b99f45a3 100644 --- a/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh +++ b/ci-operator/step-registry/ipi/deprovision/artifacts/bootstrap/ipi-deprovision-artifacts-bootstrap-commands.sh @@ -4,14 +4,12 @@ set -o nounset set -o errexit set -o pipefail -export PATH=$PATH:/tmp/shared - echo "Gathering installer artifacts ..." # we don't have jq, so the python equivalent of # jq '.modules[].resources."aws_instance.bootstrap".primary.attributes."public_ip" | select(.)' bootstrap_ip=$(python -c \ 'import sys, json; d=reduce(lambda x,y: dict(x.items() + y.items()), map(lambda x: x["resources"], json.load(sys.stdin)["modules"])); k="aws_instance.bootstrap"; print d[k]["primary"]["attributes"]["public_ip"] if k in d else ""' \ - < ${ARTIFACT_DIR}/installer/terraform.tfstate + < "${SHARED_DIR}/terraform.tfstate" ) if [ -n "${bootstrap_ip}" ] 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 f51218ba9e016..1bebf83381308 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 @@ -5,4 +5,5 @@ set -o errexit set -o pipefail echo "Deprovisioning cluster ..." -openshift-install --dir ${ARTIFACT_DIR}/installer destroy cluster +cp -ar "${SHARED_DIR}" /tmp/installer +openshift-install --dir /tmp/installer destroy cluster