Skip to content

METAL-1720: Add IRONIC_ROOTFS_URL env var for multi-arch rootfs override#583

Open
honza wants to merge 1 commit intoopenshift:mainfrom
honza:pxe-multi-arch-2
Open

METAL-1720: Add IRONIC_ROOTFS_URL env var for multi-arch rootfs override#583
honza wants to merge 1 commit intoopenshift:mainfrom
honza:pxe-multi-arch-2

Conversation

@honza
Copy link
Copy Markdown
Member

@honza honza commented Mar 30, 2026

Follow-up to #581

The image-customization-controller needs the base rootfs URL to construct arch-specific rootfs URLs for non-host architectures. Without this, aarch64 workers on an x86_64 cluster download the wrong rootfs during PXE boot.

ICC uses this URL to set ExtraKernelParams with an arch-specific rootfs URL (e.g. ironic-python-agent_aarch64.rootfs). BMO appends this after %default% in kernel_append_params, and since the last coreos.live.rootfs_url= on the kernel command line wins, the correct rootfs is downloaded.

The image-customization-controller needs the base rootfs URL to
construct arch-specific rootfs URLs for non-host architectures.
Without this, aarch64 workers on an x86_64 cluster download the
wrong rootfs during PXE boot.

ICC uses this URL to set ExtraKernelParams with an arch-specific
rootfs URL (e.g. ironic-python-agent_aarch64.rootfs). BMO appends
this after %default% in kernel_append_params, and since the last
coreos.live.rootfs_url= on the kernel command line wins, the
correct rootfs is downloaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Mar 30, 2026

@honza: This pull request references METAL-1720 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Follow-up to #581

The image-customization-controller needs the base rootfs URL to construct arch-specific rootfs URLs for non-host architectures. Without this, aarch64 workers on an x86_64 cluster download the wrong rootfs during PXE boot.

ICC uses this URL to set ExtraKernelParams with an arch-specific rootfs URL (e.g. ironic-python-agent_aarch64.rootfs). BMO appends this after %default% in kernel_append_params, and since the last coreos.live.rootfs_url= on the kernel command line wins, the correct rootfs is downloaded.

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 Mar 30, 2026

Walkthrough

Added Ironic rootfs URL configuration to the provisioning module. Introduced new constants and a getRootfsURL() function to compute rootfs URLs from Ironic IP addresses, then extended the image customization container to inject this URL as an environment variable. Corresponding test expectations were updated to reflect this change.

Changes

Cohort / File(s) Summary
Ironic Rootfs URL Handling
provisioning/image_customization.go, provisioning/image_customization_test.go
Added IRONIC_ROOTFS_URL constant and getRootfsURL() utility function to construct rootfs URLs from Ironic IPs. Extended createImageCustomizationContainer() to inject the new environment variable. Updated all test scenarios to include the expected IRONIC_ROOTFS_URL value (http://192.168.0.2:6180/images/ironic-python-agent.rootfs).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ 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 openshift-ci bot requested review from dtantsur and elfosardo March 30, 2026 19:15
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: honza

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2026
Copy link
Copy Markdown

@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)
provisioning/image_customization_test.go (1)

75-76: LGTM: Test expectations correctly updated.

All test scenarios properly include the new IRONIC_ROOTFS_URL environment variable with the expected value. The dual-stack test (container3) correctly expects only the first (IPv4) address in the rootfs URL.

Optional: Consider adding a dedicated TestGetRootfsURL function to cover edge cases (empty list, IPv6-only) similar to the existing TestGetUrlFromIP.

Also applies to: 98-99, 124-125, 147-148, 171-172

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

In `@provisioning/image_customization_test.go` around lines 75 - 76, Add a new
focused test function (e.g., TestGetRootfsURL) in
provisioning/image_customization_test.go that exercises the logic which sets
IRONIC_ROOTFS_URL (referencing the IRONIC_ROOTFS_URL env var and the same
helpers used by existing TestGetUrlFromIP) and covers edge cases: empty IP list,
IPv6-only addresses, IPv4-only, and dual-stack where the function should pick
the IPv4 address; assert the constructed rootfs URL matches expected values for
each scenario and mirror patterns used in the existing TestGetUrlFromIP to keep
consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@provisioning/image_customization_test.go`:
- Around line 75-76: Add a new focused test function (e.g., TestGetRootfsURL) in
provisioning/image_customization_test.go that exercises the logic which sets
IRONIC_ROOTFS_URL (referencing the IRONIC_ROOTFS_URL env var and the same
helpers used by existing TestGetUrlFromIP) and covers edge cases: empty IP list,
IPv6-only addresses, IPv4-only, and dual-stack where the function should pick
the IPv4 address; assert the constructed rootfs URL matches expected values for
each scenario and mirror patterns used in the existing TestGetUrlFromIP to keep
consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ad080de-3841-4840-bc9e-8366db6b7d8a

📥 Commits

Reviewing files that changed from the base of the PR and between 773f22f and e8dc722.

📒 Files selected for processing (2)
  • provisioning/image_customization.go
  • provisioning/image_customization_test.go

@sgoveas
Copy link
Copy Markdown

sgoveas commented Mar 31, 2026

/verified later @sgoveas
/retest

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sgoveas: This PR has been marked to be verified later by @sgoveas.

Details

In response to this:

/verified later @sgoveas
/retest

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.

@honza
Copy link
Copy Markdown
Member Author

honza commented Mar 31, 2026

/hold

@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 Mar 31, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

@honza: The following test 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-serial-ipv4 e8dc722 link true /test e2e-metal-ipi-serial-ipv4

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.

@honza
Copy link
Copy Markdown
Member Author

honza commented Mar 31, 2026

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 31, 2026
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. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants