Skip to content

Commit

Permalink
ci-operator/templates/openshift: Use IMAGE_TESTS for teardown gzip
Browse files Browse the repository at this point in the history
The teardown container requires oc (for retrieving cluster logs), gzip
(for compressing those logs), and openshift-install (for destroying
the cluster).  We were already copying in oc from another container;
with this commit we copy in the statically-linked openshift-install
too.  That leaves gzip, which we will be built in to IMAGE_TESTS as "a
command needed in the CI-test context".  Using IMAGE_TESTS for
teardown means we no longer need to copy oc into the shared volume for
the teardown container (although we may need to copy it in for other
containers, e.g. the src template's test container).

I've also dropped an unnecessary /bin/ prefix from the 'create
cluster' invocations, which we'd been dragging around from the
pre-shell days of 3f2f01c
(ci-operator/config/openshift/installer/master: Move to
openshift-install, 2018-09-26, #1677).
  • Loading branch information
wking committed Feb 26, 2019
1 parent e0a8e85 commit 00d7b3f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ objects:
trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
cp "$(which oc)" /tmp/shared/
mkdir -p "${HOME}"
# wait for the API to come up
Expand Down Expand Up @@ -241,6 +239,7 @@ objects:
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
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer &&
/bin/openshift-install version >/tmp/artifacts/installer/version
Expand Down Expand Up @@ -303,12 +302,12 @@ objects:
exit 1
fi
TF_LOG=debug /bin/openshift-install --dir=/tmp/artifacts/installer create cluster &
TF_LOG=debug openshift-install --dir=/tmp/artifacts/installer create cluster &
wait "$!"
# Performs cleanup of all created resources
- name: teardown
image: ${IMAGE_INSTALLER}
image: ${IMAGE_TESTS}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: shared-tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ parameters:
required: true
- name: IMAGE_FORMAT
required: true
- name: IMAGE_TESTS
required: true
- name: CLUSTER_TYPE
required: true
# Ensures the release image is created and tested
Expand Down Expand Up @@ -211,6 +213,7 @@ objects:
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
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer &&
/bin/openshift-install version >/tmp/artifacts/installer/version
Expand Down Expand Up @@ -273,12 +276,12 @@ objects:
exit 1
fi
TF_LOG=debug /bin/openshift-install --dir=/tmp/artifacts/installer create cluster &
TF_LOG=debug openshift-install --dir=/tmp/artifacts/installer create cluster &
wait "$!"
# Performs cleanup of all created resources
- name: teardown
image: ${IMAGE_INSTALLER}
image: ${IMAGE_TESTS}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: shared-tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ objects:
trap 'touch /tmp/shared/exit' EXIT
trap 'kill $(jobs -p); exit 0' TERM
cp "$(which oc)" /tmp/shared/
cp "$(command -v oc)" /tmp/shared/
mkdir -p "${HOME}"
Expand Down Expand Up @@ -304,6 +304,7 @@ objects:
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
cp "$(command -v openshift-install)" /tmp
mkdir /tmp/artifacts/installer &&
/bin/openshift-install version >/tmp/artifacts/installer/version
Expand Down Expand Up @@ -366,7 +367,7 @@ objects:
exit 1
fi
/bin/openshift-install --dir=/tmp/artifacts/installer create cluster --log-level=debug &
openshift-install --dir=/tmp/artifacts/installer create cluster --log-level=debug &
wait "$!"
# Runs scale up playbook
Expand Down Expand Up @@ -411,7 +412,7 @@ objects:
# Performs cleanup of all created resources
- name: teardown
image: ${IMAGE_INSTALLER}
image: ${IMAGE_TESTS}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: shared-tmp
Expand Down

0 comments on commit 00d7b3f

Please sign in to comment.