Skip to content

OCPBUGS-85824: Fix empty IRONIC_BASE_URL#603

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
iurygregory:OCPBUGS-85824
May 19, 2026
Merged

OCPBUGS-85824: Fix empty IRONIC_BASE_URL#603
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
iurygregory:OCPBUGS-85824

Conversation

@iurygregory

@iurygregory iurygregory commented May 18, 2026

Copy link
Copy Markdown
Contributor

When the apiServerInternalIPsis an empty list in the Infrastructure CR, the GetIronicIPsfailed to fall back to use the metal3 pod IP. This caused the metal3-image-customization to be createdy with empty IRONIC_BASE_URL, resulting in the following error in the PreprovisioningImage CR:
'Could not add ironic agent to image: ironicBaseURL is required'

The problem was that GetIronicIPs did not account for empty list.

Assisted-By: Claude 4.6 Opus High

Summary by CodeRabbit

  • Bug Fixes

    • Fixed edge case in IP provisioning logic to properly handle empty configurations with consistent fallback behavior.
  • Tests

    • Added comprehensive unit test coverage for provisioning utilities, validating IP retrieval behavior across multiple platform scenarios.

When the `apiServerInternalIPs`is an empty list in the Infrastructure
CR, the `GetIronicIPs`failed to fall back to use the metal3 pod IP.
This caused the metal3-image-customization to be createdy with empty
`IRONIC_BASE_URL`, resulting in the following error in the
`PreprovisioningImage` CR:
'Could not add ironic agent to image: ironicBaseURL is required'

The problem was that `GetIronicIPs` did not account for empty list.

Assisted-By: Claude 4.6 Opus High
Signed-off-by: Iury Gregory Melo Ferreira <imelofer@redhat.com>
@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 May 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@iurygregory: This pull request references Jira Issue OCPBUGS-85824, 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:

When the apiServerInternalIPsis an empty list in the Infrastructure CR, the GetIronicIPsfailed to fall back to use the metal3 pod IP. This caused the metal3-image-customization to be createdy with empty IRONIC_BASE_URL, resulting in the following error in the PreprovisioningImage CR:
'Could not add ironic agent to image: ironicBaseURL is required'

The problem was that GetIronicIPs did not account for empty list.

Assisted-By: Claude 4.6 Opus High

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

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 77ad4baf-b12b-4997-a192-65ceda3b4b65

📥 Commits

Reviewing files that changed from the base of the PR and between c81a51f and 66ac913.

📒 Files selected for processing (2)
  • provisioning/utils.go
  • provisioning/utils_test.go

Walkthrough

This PR fixes a fallback condition in GetIronicIPs to handle empty slices consistently with nil values, and adds comprehensive table-driven tests validating the function across ExternalIPs, VSphere, and BareMetal platform configurations with edge cases for empty and missing platform status.

Changes

GetIronicIPs Empty Slice Fallback

Layer / File(s) Summary
Empty slice fallback condition change
provisioning/utils.go
GetIronicIPs fallback logic switches from checking ironicIPs == nil to len(ironicIPs) == 0, ensuring empty internal IPs from the proxy trigger pod IP fallback.
Table-driven test coverage
provisioning/utils_test.go
New test file with TestGetIronicIPs validates ExternalIPs direct return, VSphere APIServerInternalIPs fallback to pod IPs, and BareMetal APIServerInternalIPs fallback, including edge cases for empty internal IPs and nil platform status.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 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 (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references the bug fix (empty IRONIC_BASE_URL) which is the core issue addressed by the changeset, but omits the root cause (handling empty apiServerInternalIPs list). The title is partially related to the main change.
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.
Stable And Deterministic Test Names ✅ Passed The PR adds standard Go tests (not Ginkgo) with static, deterministic test names. The custom check is specific to Ginkgo test frameworks and is not applicable to this PR.
Test Structure And Quality ✅ Passed The custom check targets Ginkgo test code quality. The added test uses standard Go testing (func Test*, testing.T, t.Run) with table-driven tests. Repository does not use Ginkgo. Check not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests added. The new test file is a standard Go unit test using testing package, not Ginkgo. Check only applies to Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added. The test in provisioning/utils_test.go is a standard Go unit test, not Ginkgo. The check is not applicable to this PR.
Topology-Aware Scheduling Compatibility ✅ Passed PR changes are limited to utility function logic and unit tests. No deployment manifests, operator configs, or scheduling constraints are introduced or modified.
Ote Binary Stdout Contract ✅ Passed This is the cluster-baremetal-operator repository, not an OTE binary. The PR adds a utility fix and a standard unit test without any process-level stdout writes. No OTE contract violations found.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR adds a standard Go unit test, not Ginkgo e2e tests. The custom check applies only to new Ginkgo e2e tests with patterns like It(), Describe(), Context(), When(). This PR is not applicable.

✏️ 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 openshift-ci Bot requested review from dtantsur and honza May 18, 2026 14:13
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@iurygregory: This pull request references Jira Issue OCPBUGS-85824, 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:

When the apiServerInternalIPsis an empty list in the Infrastructure CR, the GetIronicIPsfailed to fall back to use the metal3 pod IP. This caused the metal3-image-customization to be createdy with empty IRONIC_BASE_URL, resulting in the following error in the PreprovisioningImage CR:
'Could not add ironic agent to image: ironicBaseURL is required'

The problem was that GetIronicIPs did not account for empty list.

Assisted-By: Claude 4.6 Opus High

Summary by CodeRabbit

  • Bug Fixes

  • Fixed edge case in IP provisioning logic to properly handle empty configurations with consistent fallback behavior.

  • Tests

  • Added comprehensive unit test coverage for provisioning utilities, validating IP retrieval behavior across multiple platform scenarios.

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.

@dtantsur

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtantsur, iurygregory

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 May 18, 2026
@iurygregory

Copy link
Copy Markdown
Contributor Author

/test e2e-agnostic-ovn

@honza

honza commented May 19, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2026
@sgoveas

sgoveas commented May 19, 2026

Copy link
Copy Markdown
Contributor

/verified later @sgoveas

@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

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 verified Signifies that the PR passed pre-merge verification criteria label May 19, 2026
@openshift-ci

openshift-ci Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

@iurygregory: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 6a7e66f into openshift:main May 19, 2026
15 checks passed
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@iurygregory: Jira Issue OCPBUGS-85824: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-85824 has been moved to the MODIFIED state.

Details

In response to this:

When the apiServerInternalIPsis an empty list in the Infrastructure CR, the GetIronicIPsfailed to fall back to use the metal3 pod IP. This caused the metal3-image-customization to be createdy with empty IRONIC_BASE_URL, resulting in the following error in the PreprovisioningImage CR:
'Could not add ironic agent to image: ironicBaseURL is required'

The problem was that GetIronicIPs did not account for empty list.

Assisted-By: Claude 4.6 Opus High

Summary by CodeRabbit

  • Bug Fixes

  • Fixed edge case in IP provisioning logic to properly handle empty configurations with consistent fallback behavior.

  • Tests

  • Added comprehensive unit test coverage for provisioning utilities, validating IP retrieval behavior across multiple platform scenarios.

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.

@iurygregory

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.22

@openshift-cherrypick-robot

Copy link
Copy Markdown

@iurygregory: new pull request created: #606

Details

In response to this:

/cherry-pick release-4.22

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.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.0.0-0.nightly-2026-05-20-101113

@iurygregory

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.21

@openshift-cherrypick-robot

Copy link
Copy Markdown

@iurygregory: new pull request created: #614

Details

In response to this:

/cherry-pick release-4.21

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.

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-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. lgtm Indicates that a PR is ready to be merged. 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.

7 participants