From 5612dcc5ea9fb6a71bed2db7d0a71bc2e82c8b2a Mon Sep 17 00:00:00 2001 From: David Hurta Date: Thu, 25 Sep 2025 17:26:51 +0200 Subject: [PATCH 1/2] test: Include compressed tests binary in CVO container image To make the binary discoverable to the outside world. The following step is to register the binary in the origin repository to make the origin machine aware of the CVO tests extension. --- Dockerfile | 4 +++- Dockerfile.rhel | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68427a5d5..f2c136810 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,12 @@ WORKDIR /go/src/github.com/openshift/cluster-version-operator COPY . . RUN hack/build-go.sh; \ mkdir -p /tmp/build; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator + cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator; \ + cp _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/cluster-version-operator-tests.gz FROM registry.access.redhat.com/ubi9/ubi-minimal:latest COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/ +COPY --from=builder /tmp/build/cluster-version-operator-tests.gz /usr/bin/ COPY install /manifests COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ COPY vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ diff --git a/Dockerfile.rhel b/Dockerfile.rhel index fede93ee8..5231e1afa 100644 --- a/Dockerfile.rhel +++ b/Dockerfile.rhel @@ -3,10 +3,12 @@ WORKDIR /go/src/github.com/openshift/cluster-version-operator COPY . . RUN hack/build-go.sh; \ mkdir -p /tmp/build; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator + cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator; \ + cp _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/cluster-version-operator-tests.gz FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/ +COPY --from=builder /tmp/build/cluster-version-operator-tests.gz /usr/bin/ COPY install /manifests COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ COPY vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ From 1fd1001984919c28aceccffdccf3c51c208bee02 Mon Sep 17 00:00:00 2001 From: David Hurta Date: Wed, 29 Oct 2025 16:31:38 +0100 Subject: [PATCH 2/2] Dockerfiles: Simplify copy commands Co-authored-by: Hongkai Liu --- Dockerfile | 6 ++---- Dockerfile.rhel | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2c136810..d87f3a6c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,10 @@ WORKDIR /go/src/github.com/openshift/cluster-version-operator COPY . . RUN hack/build-go.sh; \ mkdir -p /tmp/build; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/cluster-version-operator-tests.gz + cp _output/linux/$(go env GOARCH)/cluster-version-operator _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest -COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/ -COPY --from=builder /tmp/build/cluster-version-operator-tests.gz /usr/bin/ +COPY --from=builder /tmp/build/cluster-version-operator /tmp/build/cluster-version-operator-tests.gz /usr/bin/ COPY install /manifests COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ COPY vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ diff --git a/Dockerfile.rhel b/Dockerfile.rhel index 5231e1afa..26c7e6c6f 100644 --- a/Dockerfile.rhel +++ b/Dockerfile.rhel @@ -3,12 +3,10 @@ WORKDIR /go/src/github.com/openshift/cluster-version-operator COPY . . RUN hack/build-go.sh; \ mkdir -p /tmp/build; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator /tmp/build/cluster-version-operator; \ - cp _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/cluster-version-operator-tests.gz + cp _output/linux/$(go env GOARCH)/cluster-version-operator _output/linux/$(go env GOARCH)/cluster-version-operator-tests.gz /tmp/build/ FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 -COPY --from=builder /tmp/build/cluster-version-operator /usr/bin/ -COPY --from=builder /tmp/build/cluster-version-operator-tests.gz /usr/bin/ +COPY --from=builder /tmp/build/cluster-version-operator /tmp/build/cluster-version-operator-tests.gz /usr/bin/ COPY install /manifests COPY vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/ COPY vendor/github.com/openshift/api/operator/v1alpha1/zz_generated.crd-manifests/0000_00_cluster-version-operator_* /manifests/