From 5f08526551bbdce8c1d32ccf431881d04ce946eb Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Sat, 23 May 2026 13:53:39 -0400 Subject: [PATCH 1/2] OCPBUGS-83863: Remove rhel8 build stage and version-specific bin directories The version-specific binary directories (rhel8/, rhel9/) are no longer needed since cluster-network-operator#2967 removed the OS detection logic from cnibincopy and now uses a single SOURCE_DIRECTORY. Co-Authored-By: Claude Opus 4.6 rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED --- Dockerfile.openshift | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 27f812dfd..748e8d9f3 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -8,34 +8,16 @@ RUN go build -mod vendor -o bin/ip-control-loop cmd/controlloop/controlloop.go RUN go build -mod vendor -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go WORKDIR / -FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.24-openshift-4.20 AS rhel8 -ADD . /go/src/github.com/openshift/whereabouts -WORKDIR /go/src/github.com/openshift/whereabouts -ENV CGO_ENABLED=1 -ENV GO111MODULE=on -RUN go build -mod vendor -o bin/whereabouts cmd/whereabouts.go -RUN go build -mod vendor -o bin/ip-control-loop cmd/controlloop/controlloop.go -RUN go build -mod vendor -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go -WORKDIR / - FROM registry.ci.openshift.org/ocp/4.20:base-rhel9 RUN mkdir -p /usr/src/whereabouts/images && \ - mkdir -p /usr/src/whereabouts/bin && \ - mkdir -p /usr/src/whereabouts/rhel9/bin && \ - mkdir -p /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/entrypoint.sh /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/rhel9/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/rhel9/bin -COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/rhel9/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/rhel8/bin -COPY --from=rhel8 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/rhel8/bin + mkdir -p /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/entrypoint.sh /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/whereabouts /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/ip-control-loop /usr/src/whereabouts/bin +COPY --from=rhel9 /go/src/github.com/openshift/whereabouts/bin/node-slice-controller /usr/src/whereabouts/bin LABEL org.opencontainers.image.source https://github.com/openshift/whereabouts LABEL io.k8s.display-name="Whereabouts CNI" \ io.k8s.description="This is a component of OpenShift Container Platform and provides a cluster-wide IPAM CNI plugin." \ io.openshift.tags="openshift" \ - maintainer="CTO Networking " \ No newline at end of file + maintainer="CTO Networking " From 42aaab5eeb7a79a35f3a812ecfc01407c3614e9b Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Sat, 23 May 2026 13:54:48 -0400 Subject: [PATCH 2/2] OCPBUGS-83863: Strip debug info and symbol table from binaries Co-Authored-By: Claude Opus 4.6 rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED --- Dockerfile.openshift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 748e8d9f3..3950ce691 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -3,9 +3,9 @@ ADD . /go/src/github.com/openshift/whereabouts WORKDIR /go/src/github.com/openshift/whereabouts ENV CGO_ENABLED=1 ENV GO111MODULE=on -RUN go build -mod vendor -o bin/whereabouts cmd/whereabouts.go -RUN go build -mod vendor -o bin/ip-control-loop cmd/controlloop/controlloop.go -RUN go build -mod vendor -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/whereabouts cmd/whereabouts.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/ip-control-loop cmd/controlloop/controlloop.go +RUN go build -mod vendor -ldflags '-s -w' -o bin/node-slice-controller cmd/nodeslicecontroller/node_slice_controller.go WORKDIR / FROM registry.ci.openshift.org/ocp/4.20:base-rhel9