Skip to content

clusterimageset-updater: use multi payload for 4.12+, amd64 for <4.12#4975

Open
deepsm007 wants to merge 1 commit intoopenshift:mainfrom
deepsm007:clusterimageset-updater-multi-payload
Open

clusterimageset-updater: use multi payload for 4.12+, amd64 for <4.12#4975
deepsm007 wants to merge 1 commit intoopenshift:mainfrom
deepsm007:clusterimageset-updater-multi-payload

Conversation

@deepsm007
Copy link
Contributor

@deepsm007 deepsm007 commented Feb 27, 2026

/cc @openshift/test-platform

Summary by CodeRabbit

  • New Features

    • Dynamic architecture selection for cluster image set payloads based on version bounds
    • Enables multi-architecture payload support for OpenShift 4.12 and later while retaining AMD64 for earlier versions
  • Tests

    • Added test coverage for the architecture selection logic

@openshift-ci-robot
Copy link
Contributor

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

@openshift-ci openshift-ci bot requested a review from a team February 27, 2026 20:28
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent 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 1241608 and da218e6.

📒 Files selected for processing (2)
  • cmd/clusterimageset-updater/main.go
  • cmd/clusterimageset-updater/main_test.go

Walkthrough

The changes add architecture determination logic to support multi-architecture payloads for OpenShift versions 4.12 and later. A new architectureForBounds() function is introduced to select the appropriate architecture (AMD64 for versions below 4.12, MULTI for 4.12+) based on version bounds, replacing hard-coded constants in the cluster image resolution workflow.

Changes

Cohort / File(s) Summary
Architecture Logic
cmd/clusterimageset-updater/main.go
Adds strconv import and introduces architectureForBounds() function that determines release architecture based on version bounds (AMD64 for minor < 12 or unparsable, MULTI for 4.12+). Updates main to use computed architecture instead of hard-coded AMD64.
Test Coverage
cmd/clusterimageset-updater/main_test.go
Adds TestArchitectureForBounds() with table-driven test cases validating architecture selection logic for various VersionBounds inputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.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 accurately summarizes the main change: introducing multi-payload support for OpenShift 4.12+ while maintaining AMD64 for earlier versions in the clusterimageset-updater.
Stable And Deterministic Test Names ✅ Passed All test names in TestArchitectureForBounds are stable and deterministic with static descriptive strings and no dynamic information.
Test Structure And Quality ✅ Passed The TestArchitectureForBounds test meets all five quality requirements: single responsibility (each case tests one version/architecture mapping), appropriate setup/cleanup (none needed for pure function), no timeout issues (no cluster operations), meaningful assertion messages, and consistency with existing table-driven test patterns using t.Run() subtests.

✏️ 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
@hector-vido
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
cmd/clusterimageset-updater/main_test.go (1)

26-33: Add a major-version boundary case to lock behavior.

Current cases are strong for 4.x, but there’s no guard for 5.x (or other non-4.x) parsing behavior. Adding that case will prevent silent regressions in architectureForBounds.

✅ Suggested test additions
 		{"4.21 uses multi", api.VersionBounds{Lower: "4.21.0-0", Upper: "4.22.0-0"}, api.ReleaseArchitectureMULTI},
+		{"5.0 uses multi", api.VersionBounds{Lower: "5.0.0-0", Upper: "5.1.0-0"}, api.ReleaseArchitectureMULTI},
+		{"3.13 uses amd64", api.VersionBounds{Lower: "3.13.0-0", Upper: "3.14.0-0"}, api.ReleaseArchitectureAMD64},
 		{"unparseable lower uses amd64", api.VersionBounds{Lower: "bad", Upper: "4.8.0-0"}, api.ReleaseArchitectureAMD64},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/clusterimageset-updater/main_test.go` around lines 26 - 33, Add a test
row to the existing table in cmd/clusterimageset-updater/main_test.go covering a
non-4.x major boundary (e.g., a "5.x" range) to assert architectureForBounds
handles non-4 majors consistently; update the test table (the same slice
containing cases like "4.7 uses amd64") with a case such as a Lower "5.0.0-0"
and Upper "5.1.0-0" expecting the default (e.g., api.ReleaseArchitectureAMD64)
so architectureForBounds is exercised for non-4.x input and future regressions
are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/clusterimageset-updater/main.go`:
- Around line 331-344: architectureForBounds currently only checks the parsed
minor version from bounds.Lower and ignores the major version, causing wrong
classification for non-4.x releases; update architectureForBounds to parse both
major and minor (from parts[0] and parts[1]) as integers, handle parse errors by
returning api.ReleaseArchitectureAMD64, then return api.ReleaseArchitectureMULTI
when (major > 4) OR (major == 4 AND minor >= 12), otherwise return
api.ReleaseArchitectureAMD64; keep parsing fallback behavior and reference
bounds.Lower and the architectureForBounds function.

---

Nitpick comments:
In `@cmd/clusterimageset-updater/main_test.go`:
- Around line 26-33: Add a test row to the existing table in
cmd/clusterimageset-updater/main_test.go covering a non-4.x major boundary
(e.g., a "5.x" range) to assert architectureForBounds handles non-4 majors
consistently; update the test table (the same slice containing cases like "4.7
uses amd64") with a case such as a Lower "5.0.0-0" and Upper "5.1.0-0" expecting
the default (e.g., api.ReleaseArchitectureAMD64) so architectureForBounds is
exercised for non-4.x input and future regressions are caught.

ℹ️ 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 c96dc28 and 1241608.

📒 Files selected for processing (2)
  • cmd/clusterimageset-updater/main.go
  • cmd/clusterimageset-updater/main_test.go

@deepsm007 deepsm007 force-pushed the clusterimageset-updater-multi-payload branch from 1241608 to da218e6 Compare February 27, 2026 20:46
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2026
@hector-vido
Copy link
Contributor

/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: deepsm007, hector-vido

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:
  • OWNERS [deepsm007,hector-vido]

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

@deepsm007
Copy link
Contributor Author

/test e2e

@deepsm007
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 28, 2026

@deepsm007: 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/breaking-changes da218e6 link false /test breaking-changes
ci/prow/images da218e6 link true /test images
ci/prow/e2e da218e6 link true /test e2e

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. 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