From 7c900255c77644e053e843a6892dfeef98902a6c Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Fri, 11 Jul 2025 05:03:32 +0100 Subject: [PATCH] UPSTREAM: : [OTE]: Add binary in the operator controller image to allow proper integration with OCP tests --- openshift/operator-controller.Dockerfile | 11 ++++++++++- openshift/tests-extension/Dockerfile | 20 -------------------- 2 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 openshift/tests-extension/Dockerfile diff --git a/openshift/operator-controller.Dockerfile b/openshift/operator-controller.Dockerfile index 2c8ca6b8fb..843861b7d4 100644 --- a/openshift/operator-controller.Dockerfile +++ b/openshift/operator-controller.Dockerfile @@ -1,11 +1,20 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder WORKDIR /build COPY . . -RUN make go-build-local +RUN make go-build-local && \ + # Build the OLMv1 Test Extension binary. + # This is used by openshift/origin to allow us to register the OLMv1 test extension + # The binary needs to be added in the component image and OCP image + cd openshift/tests-extension && \ + make build && \ + mkdir -p /tmp/build && \ + cp ./bin/olmv1-tests-ext /tmp/build/olmv1-tests-ext && \ + gzip -f /tmp/build/olmv1-tests-ext FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 USER 1001 COPY --from=builder /build/bin/operator-controller /operator-controller +COPY --from=builder /tmp/build/olmv1-tests-ext.gz /usr/bin/olmv1-tests-ext.gz COPY openshift/operator-controller/cp-manifests /cp-manifests COPY openshift/operator-controller/manifests /openshift/manifests COPY openshift/operator-controller/manifests-experimental /openshift/manifests-experimental diff --git a/openshift/tests-extension/Dockerfile b/openshift/tests-extension/Dockerfile deleted file mode 100644 index 3dc6905ef9..0000000000 --- a/openshift/tests-extension/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Builds the test bin olmv1-tests-ext from the source code. -# The bin will be used in the final image (olm-operator-controller) -# so it can be used by openshift-tests. -# See: https://github.com/openshift/origin/blob/main/pkg/test/extensions/binary.go#L53-L62 -FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.24-openshift-4.20 AS builder - -WORKDIR /build -COPY . . - -# Build the olmv1-tests-ext binary. -RUN make build && \ - gzip -f ./bin/olmv1-tests-ext - -# Copy directly from the build output directory -FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 -COPY --from=builder /build/bin/olmv1-tests-ext.gz /usr/bin/olmv1-tests-ext.gz - -LABEL io.k8s.display-name="OLMv1 Operator Controller" \ - io.openshift.release.operator=true \ - io.openshift.tags="openshift,tests,e2e,e2e-extension"