Skip to content

OCPBUGS-83863: Remove RHEL 8 binary build from Dockerfile#3149

Open
sdodson wants to merge 4 commits intoopenshift:masterfrom
sdodson:el9-only
Open

OCPBUGS-83863: Remove RHEL 8 binary build from Dockerfile#3149
sdodson wants to merge 4 commits intoopenshift:masterfrom
sdodson:el9-only

Conversation

@sdodson
Copy link
Copy Markdown
Member

@sdodson sdodson commented Apr 21, 2026

Summary

  • Remove the rhel8 multi-stage build that compiled a second set of binaries with the RHEL 8 Go toolchain
  • Remove RHEL 8 shim copies (/usr/libexec/cni/rhel8/ovn-k8s-cni-overlay, /usr/lib/rhel8/ovnkube-trace) from the final image
  • Apply -w -s LDFLAGS to all binary builds (including ovnkube) to strip debug info and reduce image size
  • Add /usr/libexec/cni/rhel9/ and /usr/libexec/cni/rhel10/ directories with hard links to the single ovn-k8s-cni-overlay binary so the CNO's ovnkube-node startup script can find the right binary for each RHEL version

Test plan

  • Verify the image builds successfully without the rhel8 stage
  • Verify RHEL 9 nodes get the correct CNI binary from /usr/libexec/cni/rhel9/
  • Verify RHEL 10 nodes get the correct CNI binary from /usr/libexec/cni/rhel10/
  • Confirm no RHEL 8 nodes remain in supported clusters
  • Verify stripped binaries function correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Final container image now ships only RHEL‑9 runtime components; RHEL‑8 runtime shims removed.
    • CNI layout consolidated: RHEL‑9 and RHEL‑10 directories point to a single built CNI binary via hard links.
    • Build pipeline simplified to produce and package a single set of runtime artifacts, reducing image size and surface area.
    • Linker flags standardized across builds to produce smaller, stripped binaries for consistent outputs.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-83870, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • Remove the rhel8 multi-stage build that compiled a second set of binaries with the RHEL 8 Go toolchain
  • Remove RHEL 8 shim copies (/usr/libexec/cni/rhel8/ovn-k8s-cni-overlay, /usr/lib/rhel8/ovnkube-trace) from the final image
  • Retain the rhel9/ directory structure so future RHEL versions (10, 11) can be added by introducing a new build stage

Test plan

  • Verify the image builds successfully without the rhel8 stage
  • Verify RHEL 9 nodes get the correct CNI shim from /usr/libexec/cni/rhel9/
  • Confirm no RHEL 8 nodes remain in supported clusters

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Enterprise

Run ID: ca1edf57-8609-485a-afaa-bbcef2c703ad

📥 Commits

Reviewing files that changed from the base of the PR and between e9d510d and f0b23c7.

📒 Files selected for processing (2)
  • Dockerfile
  • go-controller/hack/build-go.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • go-controller/hack/build-go.sh

Walkthrough

Removed the RHEL‑8 build stage and RHEL‑8 artifact copies from the Dockerfile; final image is produced from the RHEL‑9 builder and now creates /usr/libexec/cni/rhel9 and /usr/libexec/cni/rhel10 pointing via hard links to the single built CNI. Build script now unconditionally injects ${LDFLAGS} (e.g., -w -s) into all -ldflags, including Windows builds.

Changes

Cohort / File(s) Summary
Dockerfile - builder and artifact layout
Dockerfile
Removed rhel8 build stage and its artifact copy steps; go-controller builder adds stripped linker flags (LDFLAGS="-w -s") to built binaries. Final image creates /usr/libexec/cni/rhel9 and /usr/libexec/cni/rhel10 and uses hard links to a single ovn-k8s-cni-overlay instead of separate RHEL‑8 artifacts; ovnkube-trace RHEL‑8 install removed.
Build script - unconditional LDFLAGS
go-controller/hack/build-go.sh
Replaced conditional command-substitution logic so ${LDFLAGS} is now appended unconditionally to -ldflags for native and Windows builds; all binaries (including ovnkube) receive ${LDFLAGS} during linking.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibbled stage eight from the stack,
Linked flags in place, no turning back.
One CNI to rule both nine and ten,
Binaries lighter — hop again, my friend! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: removing RHEL 8 binary build from Dockerfile, which aligns with the primary objective of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-83870, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Summary

  • Remove the rhel8 multi-stage build that compiled a second set of binaries with the RHEL 8 Go toolchain
  • Remove RHEL 8 shim copies (/usr/libexec/cni/rhel8/ovn-k8s-cni-overlay, /usr/lib/rhel8/ovnkube-trace) from the final image
  • Retain the rhel9/ directory structure so future RHEL versions (10, 11) can be added by introducing a new build stage

Test plan

  • Verify the image builds successfully without the rhel8 stage
  • Verify RHEL 9 nodes get the correct CNI shim from /usr/libexec/cni/rhel9/
  • Confirm no RHEL 8 nodes remain in supported clusters

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
  • Removed RHEL-8 binary support from the container image. The image now exclusively includes RHEL-9 components, streamlining the build process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sdodson
Once this PR has been reviewed and has the lgtm label, please assign martinkennelly for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sdodson sdodson changed the title OCPBUGS-83870: Remove RHEL 8 binary build from Dockerfile OCPBUGS-83868: Remove RHEL 8 binary build from Dockerfile Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-83868, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • Remove the rhel8 multi-stage build that compiled a second set of binaries with the RHEL 8 Go toolchain
  • Remove RHEL 8 shim copies (/usr/libexec/cni/rhel8/ovn-k8s-cni-overlay, /usr/lib/rhel8/ovnkube-trace) from the final image
  • Retain the rhel9/ directory structure so future RHEL versions (10, 11) can be added by introducing a new build stage

Test plan

  • Verify the image builds successfully without the rhel8 stage
  • Verify RHEL 9 nodes get the correct CNI shim from /usr/libexec/cni/rhel9/
  • Confirm no RHEL 8 nodes remain in supported clusters

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
  • Removed RHEL‑8 runtime artifacts and shim binaries from the container image; the final image now contains only RHEL‑9 components.
  • Simplified the build output and packaging so only RHEL‑9-built binaries are included, reducing image contents and streamlining the build pipeline.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. label Apr 21, 2026
@sdodson sdodson changed the title OCPBUGS-83868: Remove RHEL 8 binary build from Dockerfile OCPBUGS-83863: Remove RHEL 8 binary build from Dockerfile Apr 21, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sdodson: This pull request references Jira Issue OCPBUGS-83863, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • Remove the rhel8 multi-stage build that compiled a second set of binaries with the RHEL 8 Go toolchain
  • Remove RHEL 8 shim copies (/usr/libexec/cni/rhel8/ovn-k8s-cni-overlay, /usr/lib/rhel8/ovnkube-trace) from the final image
  • Retain the rhel9/ directory structure so future RHEL versions (10, 11) can be added by introducing a new build stage

Test plan

  • Verify the image builds successfully without the rhel8 stage
  • Verify RHEL 9 nodes get the correct CNI shim from /usr/libexec/cni/rhel9/
  • Confirm no RHEL 8 nodes remain in supported clusters

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
  • Removed RHEL‑8 runtime artifacts and shim binaries from the container image; the final image now contains only RHEL‑9 components.
  • Simplified the build output and packaging so only RHEL‑9-built binaries are included, reducing image contents and streamlining the build pipeline.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. label Apr 21, 2026
@sdodson
Copy link
Copy Markdown
Member Author

sdodson commented Apr 21, 2026

/hold
Need to test all of these together

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 21, 2026
sdodson and others added 4 commits April 28, 2026 14:27
RHEL 8 nodes are no longer supported. Remove the rhel8 build stage
and all version-specific binary copies from the container image.
The default binary at /usr/libexec/cni/ovn-k8s-cni-overlay is built
with the rhel9 toolchain. Future RHEL versions can add override
binaries in /usr/libexec/cni/rhel{10,11}/ subdirectories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the conditional that excluded ovnkube from LDFLAGS so that
strip flags like -w -s apply uniformly to all built binaries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass LDFLAGS="-w -s" to strip symbol tables and DWARF debug info
from all binaries, reducing the final image size.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create /usr/libexec/cni/rhel9/ and /usr/libexec/cni/rhel10/ directories
with hard links to the single ovn-k8s-cni-overlay binary so the CNO's
ovnkube-node container startup script can locate the correct binary for
each RHEL version. RHEL 10 reuses the RHEL 9 binary until a separate
build is needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 29, 2026

@sdodson: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security f0b23c7 link false /test security
ci/prow/e2e-aws-ovn-upgrade f0b23c7 link true /test e2e-aws-ovn-upgrade
ci/prow/e2e-metal-ipi-ovn-dualstack f0b23c7 link true /test e2e-metal-ipi-ovn-dualstack
ci/prow/e2e-azure-ovn-upgrade f0b23c7 link true /test e2e-azure-ovn-upgrade
ci/prow/e2e-metal-ipi-ovn-dualstack-bgp f0b23c7 link true /test e2e-metal-ipi-ovn-dualstack-bgp
ci/prow/e2e-metal-ipi-ovn-dualstack-bgp-local-gw f0b23c7 link true /test e2e-metal-ipi-ovn-dualstack-bgp-local-gw
ci/prow/e2e-aws-ovn-upgrade-local-gateway f0b23c7 link true /test e2e-aws-ovn-upgrade-local-gateway
ci/prow/e2e-metal-ipi-ovn-ipv6 f0b23c7 link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn-rhcos10-techpreview f0b23c7 link false /test e2e-aws-ovn-rhcos10-techpreview

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants