Skip to content

TRT-2562: Add architecture filtering to extension binary registry#30817

Open
stbenjam wants to merge 1 commit intoopenshift:mainfrom
stbenjam:arches
Open

TRT-2562: Add architecture filtering to extension binary registry#30817
stbenjam wants to merge 1 commit intoopenshift:mainfrom
stbenjam:arches

Conversation

@stbenjam
Copy link
Member

@stbenjam stbenjam commented Feb 27, 2026

Some extension binaries (like aws-cloud-controller-manager) are only available on specific architectures. Add an optional architectures field to TestBinary that, when specified, limits extraction to only those architectures. This prevents extraction failures on s390x and ppc64le where the binary doesn't exist in the image.

Summary by CodeRabbit

Release Notes

  • New Features
    • Extension binaries now support architecture-specific filtering, automatically selecting only binaries compatible with your host system's processor architecture.
    • Enhanced logging now clearly reports when binaries are skipped due to architecture compatibility issues, providing better visibility into the selection process.

Some extension binaries (like aws-cloud-controller-manager) are only
available on specific architectures. Add an optional architectures
field to TestBinary that, when specified, limits extraction to only
those architectures. This prevents extraction failures on s390x and
ppc64le where the binary doesn't exist in the image.

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

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

Walkthrough

Introduces architecture-specific filtering for extension binaries in the test framework. Adds a new architectures field to the TestBinary struct to specify supported host architectures, implements filtering and validation functions, and integrates architecture checking into the binary extraction process.

Changes

Cohort / File(s) Summary
Architecture-Specific Binary Filtering
pkg/test/extensions/binary.go
Added architectures []string field to TestBinary struct to denote supported host architectures. Implemented supportsCurrentArchitecture() method to determine binary compatibility with current GOARCH, and filterExtensionBinariesByArchitecture() function to filter binaries by architecture. Integrated filtering into ExtractAllTestBinaries() with enhanced logging for skipped binaries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Test cleanup not using Go idiomatic patterns (defer/t.Cleanup); environment variables set at lines 101-111 but cleanup at lines 128-129 lacks guaranteed execution. Add defer block immediately after environment variable setup to guarantee cleanup on all test exit paths, or consolidate cleanup in single defer statement at start of t.Run callback.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Stable And Deterministic Test Names ✅ Passed The modified file pkg/test/extensions/binary.go contains no test declarations with dynamic information in test names.
Title check ✅ Passed The title accurately describes the main change: adding architecture filtering to extension binaries in the registry.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pkg/test/extensions/binary.go (1)

984-998: Add focused unit coverage for architecture filtering.

Consider table-driven tests for:

  • empty architectures (allow all),
  • matching current arch (allow),
  • non-matching arch (skip).

This would make future binary-registry edits safer.

Also applies to: 1014-1027

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/extensions/binary.go` around lines 984 - 998, Add focused
table-driven unit tests for architecture filtering to cover empty architectures
(should allow all), a matching current architecture (should include), and a
non-matching architecture (should skip). Create tests that construct TestBinary
values exercising supportsCurrentArchitecture() and call
filterExtensionBinariesByArchitecture(), asserting the returned slice contains
or omits the binary as expected; do the same for the similar logic referenced
around lines 1014-1027. Use test helpers to set or simulate runtime.GOARCH where
needed and name cases clearly (e.g., "empty-architectures", "matching-arch",
"non-matching-arch") so future registry edits are validated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/test/extensions/binary.go`:
- Around line 984-998: Add focused table-driven unit tests for architecture
filtering to cover empty architectures (should allow all), a matching current
architecture (should include), and a non-matching architecture (should skip).
Create tests that construct TestBinary values exercising
supportsCurrentArchitecture() and call filterExtensionBinariesByArchitecture(),
asserting the returned slice contains or omits the binary as expected; do the
same for the similar logic referenced around lines 1014-1027. Use test helpers
to set or simulate runtime.GOARCH where needed and name cases clearly (e.g.,
"empty-architectures", "matching-arch", "non-matching-arch") so future registry
edits are validated.

ℹ️ Review info

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6a141 and 530696e.

📒 Files selected for processing (1)
  • pkg/test/extensions/binary.go

@stbenjam
Copy link
Member Author

/test images

@stbenjam stbenjam changed the title Add architecture filtering to extension binary registry TRT-2562: Add architecture filtering to extension binary registry Feb 27, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 27, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 27, 2026

@stbenjam: This pull request references TRT-2562 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Some extension binaries (like aws-cloud-controller-manager) are only available on specific architectures. Add an optional architectures field to TestBinary that, when specified, limits extraction to only those architectures. This prevents extraction failures on s390x and ppc64le where the binary doesn't exist in the image.

Summary by CodeRabbit

Release Notes

  • New Features
  • Extension binaries now support architecture-specific filtering, automatically selecting only binaries compatible with your host system's processor architecture.
  • Enhanced logging now clearly reports when binaries are skipped due to architecture compatibility issues, providing better visibility into the selection 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.

@stbenjam
Copy link
Member Author

/test unit

Copy link

@locriandev locriandev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: locriandev, stbenjam

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

The pull request process is described 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

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 27, 2026

@stbenjam: 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/e2e-metal-ipi-ovn-ipv6 530696e link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn-fips 530696e link true /test e2e-aws-ovn-fips
ci/prow/e2e-aws-ovn-serial-1of2 530696e link true /test e2e-aws-ovn-serial-1of2

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants