Skip to content

Commit 00d7b3f

Browse files
committed
ci-operator/templates/openshift: Use IMAGE_TESTS for teardown gzip
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).
1 parent e0a8e85 commit 00d7b3f

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ objects:
115115
trap 'touch /tmp/shared/exit' EXIT
116116
trap 'kill $(jobs -p); exit 0' TERM
117117
118-
cp "$(which oc)" /tmp/shared/
119-
120118
mkdir -p "${HOME}"
121119
122120
# wait for the API to come up
@@ -241,6 +239,7 @@ objects:
241239
trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT
242240
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
243241
242+
cp "$(command -v openshift-install)" /tmp
244243
mkdir /tmp/artifacts/installer &&
245244
/bin/openshift-install version >/tmp/artifacts/installer/version
246245
@@ -303,12 +302,12 @@ objects:
303302
exit 1
304303
fi
305304
306-
TF_LOG=debug /bin/openshift-install --dir=/tmp/artifacts/installer create cluster &
305+
TF_LOG=debug openshift-install --dir=/tmp/artifacts/installer create cluster &
307306
wait "$!"
308307
309308
# Performs cleanup of all created resources
310309
- name: teardown
311-
image: ${IMAGE_INSTALLER}
310+
image: ${IMAGE_TESTS}
312311
terminationMessagePolicy: FallbackToLogsOnError
313312
volumeMounts:
314313
- name: shared-tmp

ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ parameters:
1818
required: true
1919
- name: IMAGE_FORMAT
2020
required: true
21+
- name: IMAGE_TESTS
22+
required: true
2123
- name: CLUSTER_TYPE
2224
required: true
2325
# Ensures the release image is created and tested
@@ -211,6 +213,7 @@ objects:
211213
trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT
212214
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
213215
216+
cp "$(command -v openshift-install)" /tmp
214217
mkdir /tmp/artifacts/installer &&
215218
/bin/openshift-install version >/tmp/artifacts/installer/version
216219
@@ -273,12 +276,12 @@ objects:
273276
exit 1
274277
fi
275278
276-
TF_LOG=debug /bin/openshift-install --dir=/tmp/artifacts/installer create cluster &
279+
TF_LOG=debug openshift-install --dir=/tmp/artifacts/installer create cluster &
277280
wait "$!"
278281
279282
# Performs cleanup of all created resources
280283
- name: teardown
281-
image: ${IMAGE_INSTALLER}
284+
image: ${IMAGE_TESTS}
282285
terminationMessagePolicy: FallbackToLogsOnError
283286
volumeMounts:
284287
- name: shared-tmp

ci-operator/templates/openshift/openshift-ansible/cluster-scaleup-e2e-40.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ objects:
118118
trap 'touch /tmp/shared/exit' EXIT
119119
trap 'kill $(jobs -p); exit 0' TERM
120120
121-
cp "$(which oc)" /tmp/shared/
121+
cp "$(command -v oc)" /tmp/shared/
122122
123123
mkdir -p "${HOME}"
124124
@@ -304,6 +304,7 @@ objects:
304304
trap 'rc=$?; if test "${rc}" -eq 0; then touch /tmp/setup-success; else touch /tmp/exit; fi; exit "${rc}"' EXIT
305305
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
306306
307+
cp "$(command -v openshift-install)" /tmp
307308
mkdir /tmp/artifacts/installer &&
308309
/bin/openshift-install version >/tmp/artifacts/installer/version
309310
@@ -366,7 +367,7 @@ objects:
366367
exit 1
367368
fi
368369
369-
/bin/openshift-install --dir=/tmp/artifacts/installer create cluster --log-level=debug &
370+
openshift-install --dir=/tmp/artifacts/installer create cluster --log-level=debug &
370371
wait "$!"
371372
372373
# Runs scale up playbook
@@ -411,7 +412,7 @@ objects:
411412
412413
# Performs cleanup of all created resources
413414
- name: teardown
414-
image: ${IMAGE_INSTALLER}
415+
image: ${IMAGE_TESTS}
415416
terminationMessagePolicy: FallbackToLogsOnError
416417
volumeMounts:
417418
- name: shared-tmp

0 commit comments

Comments
 (0)