From e3b1418a8f9f953be23de8f6ffd333f310246251 Mon Sep 17 00:00:00 2001 From: Jose Valdes Date: Thu, 25 Aug 2022 17:37:35 -0400 Subject: [PATCH 1/2] [build] Stop downloading oc client This change leverages the introduction of the oc client in the test images, making the build process simpler. Follow-up to https://github.com/openshift/release/pull/26395 (cherry picked from commit c1fa08c27afa53078a18087c39ef2714e581f9f0) --- build/Dockerfile.ci | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/build/Dockerfile.ci b/build/Dockerfile.ci index fd6124ded8..08ad1506a3 100644 --- a/build/Dockerfile.ci +++ b/build/Dockerfile.ci @@ -10,13 +10,6 @@ WORKDIR /build/ # dos2unix is needed to build CNI plugins RUN yum install -y dos2unix -# Download client binaries -# TODO: Remove this, see https://issues.redhat.com/browse/WINC-520 -RUN curl -L -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.6.4/openshift-client-linux-4.6.4.tar.gz -o openshift-origin-client-tools.tar.gz \ - && echo "c1f39a966fc0dbd4f8f0bfec0196149d54e0330de523bf906bbe2728b10a860b openshift-origin-client-tools.tar.gz" | sha256sum -c \ - && tar -xzf openshift-origin-client-tools.tar.gz \ - && rm -rf ./{kubectl,openshift*,README.md} - # The source here corresponds to the code in the PR and is placed here by the CI infrastructure. WORKDIR /build/windows-machine-config-operator/ # Copy .git metadata so that we can generate the version for the WMCO binary @@ -167,10 +160,6 @@ ENV OPERATOR=/usr/local/bin/windows-machine-config-operator \ # jq is needed in e2e test script to count the number of data items in the windows-instances ConfigMap RUN yum install -y jq -# Install client binaries -COPY --from=build /build/oc /usr/bin/oc -RUN oc version - # Copy the source code to be used by our ci infra WORKDIR /go/src/github.com/openshift/windows-machine-config-operator/ COPY --from=build /build/windows-machine-config-operator . From a2c672a58d6c64fbf576f327c13a455f32d9a8c3 Mon Sep 17 00:00:00 2001 From: Jose Valdes Date: Mon, 29 Aug 2022 18:00:38 -0400 Subject: [PATCH 2/2] [hack] Ensure oc cli is present for e2e tests This change ensures the oc binary is present, or fails otherwise. In addition, prints the location and the version. (cherry picked from commit bad87d2337998c85cb6621b58607cea84e588b80) --- hack/run-ci-e2e-test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hack/run-ci-e2e-test.sh b/hack/run-ci-e2e-test.sh index e40b9f55df..ad0513f208 100755 --- a/hack/run-ci-e2e-test.sh +++ b/hack/run-ci-e2e-test.sh @@ -3,6 +3,17 @@ set -o errexit set -o nounset set -o pipefail +# This script depends on the oc client. In CI, the oc cli is injected according +# to the given OCP version. See https://github.com/openshift/release/pull/26395 +# ensure oc client is available +which oc || { + # fails otherwise + echo "cannot find oc binary in PATH" + exit 1 +} +# print oc client version +oc version + WMCO_ROOT=$(dirname "${BASH_SOURCE}")/.. source $WMCO_ROOT/hack/common.sh