Skip to content

OCPBUGS-86671: Fix InternalReleaseImage URL transform#6100

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bfournie:iri-image-e22-fail
May 28, 2026
Merged

OCPBUGS-86671: Fix InternalReleaseImage URL transform#6100
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bfournie:iri-image-e22-fail

Conversation

@bfournie
Copy link
Copy Markdown
Contributor

@bfournie bfournie commented May 28, 2026

The conversion of the image url from the MCN to IRI was not being done properly. For example if the MCN had:
localhost.localdomain:22625/openshift/release-images@sha256:

The resulting IRI image was
api-int.ostest.test.metalkube.org.localdomain:22625/openshift/release-images@sha256:

It should not contain "localdomain".

- What I did

- How to verify it

- Description for the changelog

Summary by CodeRabbit

  • Bug Fixes

    • Improved internal API URL transformation to more reliably handle host:port forms (including localhost variants), reducing malformed internal endpoints.
  • Tests

    • Added table-driven unit tests covering multiple URL/host scenarios, port handling, and edge cases to ensure consistent behavior.

@openshift-merge-bot
Copy link
Copy Markdown
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: LGTM mode

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

@bfournie: This pull request references Jira Issue OCPBUGS-86671, 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 ASSIGNED, 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:

The conversion of the image url from the MCN to IRI was not being done properly. For example if the MCN had:
localhost.localdomain:22625/openshift/release-images@sha256:

The resulting IRI image was
api-int.ostest.test.metalkube.org.localdomain:22625/openshift/release-images@sha256:

It should not contain "localdomain".

- What I did

- How to verify it

- Description for the changelog

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 May 28, 2026

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: 6e882de1-c0cb-4543-a16d-a2a20f06b0bc

📥 Commits

Reviewing files that changed from the base of the PR and between b763a1a and 78cf83b.

📒 Files selected for processing (2)
  • pkg/controller/internalreleaseimage/aggregation.go
  • pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go
  • pkg/controller/internalreleaseimage/aggregation.go

Walkthrough

Refactors transformToAPIIntURL to parse host:port (trimming path) and rebuild the host as api-int.:; adds a table-driven TestTransformToAPIIntURL covering localhost, localhost.localdomain, portless, digest-path, and non-localhost-with-port cases.

Changes

URL Transformation Parser

Layer / File(s) Summary
Update transformToAPIIntURL and add tests
pkg/controller/internalreleaseimage/aggregation.go, pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go
transformToAPIIntURL now trims any path, finds the first : to separate host and port, replaces the hostname portion with api-int.<clusterDomain> while preserving the port and path, and returns the original string when no : is present. A new table-driven test TestTransformToAPIIntURL validates multiple hostname and port scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 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 (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: fixing the InternalReleaseImage URL transform logic to correctly handle localhost-style URLs by splitting on port instead of simple string replacement.
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 added test is a standard Go table-driven test, not a Ginkgo test. Ginkgo-specific requirements do not apply; all test case names are static and descriptive.
Test Structure And Quality ✅ Passed Test added uses standard Go testing.T table-driven pattern, not Ginkgo. Check's requirements for Ginkgo patterns (It blocks, BeforeEach/AfterEach, cluster interactions) don't apply.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR. The only test added is TestTransformToAPIIntURL, a standard Go unit test that tests URL transformation logic without using MicroShift-incompatible APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only standard Go unit tests (TestTransformToAPIIntURL), not Ginkgo e2e tests. Check applies only to Ginkgo e2e tests, so it is not applicable here.
Topology-Aware Scheduling Compatibility ✅ Passed PR changes only URL transformation utility functions in aggregation.go and tests—no scheduling constraints, affinities, tolerations, or PodDisruptionBudgets introduced.
Ote Binary Stdout Contract ✅ Passed PR modifies only utility function transformToAPIIntURL and adds isolated unit test; neither are process-level entry points and contain no stdout writes that could violate OTE contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests added. TestTransformToAPIIntURL is a standard Go unit test that tests a string-manipulation utility function with no IPv4 assumptions or external connectivity requirements.
No-Weak-Crypto ✅ Passed PR introduces only URL string manipulation with no weak crypto algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret comparisons.
Container-Privileges ✅ Passed PR modifies only Go source files for URL transformation logic; contains no container/K8s manifests and no privilege-related configurations.
No-Sensitive-Data-In-Logs ✅ Passed PR logs only internal cluster hostnames (at debug level V(4)), node names, and generic error messages. No credentials, tokens, certificates, PII, or sensitive data exposed in logs.

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

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@openshift-ci openshift-ci Bot requested review from pawanpinjarkar and zaneb May 28, 2026 12:57
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

The conversion of the image url from the MCN to IRI was not being done properly. For example if the MCN had:
localhost.localdomain:22625/openshift/release-images@sha256:

The resulting IRI image was
api-int.ostest.test.metalkube.org.localdomain:22625/openshift/release-images@sha256:

It should not contain "localdomain".

- What I did

- How to verify it

- Description for the changelog

Summary by CodeRabbit

  • Bug Fixes

  • Enhanced internal API URL transformation to handle localhost URLs more reliably through improved port parsing and URL rebuilding.

  • Tests

  • Added comprehensive table-driven unit tests validating URL transformation across multiple scenarios, including port handling and edge cases.

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.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go (1)

485-489: ⚡ Quick win

Add regression cases for pullspecs containing sha256: and for non-localhost hosts.

The current “no port” case (localhost) doesn’t catch the digest-colon parsing edge case. Please add cases like localhost/...@sha256:... (expect unchanged if no host port) and a non-localhost input (expect unchanged).

Also applies to: 492-497

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go`
around lines 485 - 489, Update the test table entries around the "no port
returns input unchanged" case to add regression cases that ensure inputs
containing image digests and non-localhost hostnames are left unchanged: add a
case with localhost plus a digest like "localhost/repo@sha256:abcdef..."
(expected "localhost/repo@sha256:abcdef...") and add a non-localhost host case
such as "registry.example.com/repo:tag" (expected unchanged). Mirror the same
two new cases in the second group referenced (the block around lines ~492-497)
so both test groups cover the sha256-colon parsing edge and non-localhost
behavior; ensure the new cases use the same table structure and test name
pattern so the existing test loop picks them up.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go`:
- Around line 485-489: Update the test table entries around the "no port returns
input unchanged" case to add regression cases that ensure inputs containing
image digests and non-localhost hostnames are left unchanged: add a case with
localhost plus a digest like "localhost/repo@sha256:abcdef..." (expected
"localhost/repo@sha256:abcdef...") and add a non-localhost host case such as
"registry.example.com/repo:tag" (expected unchanged). Mirror the same two new
cases in the second group referenced (the block around lines ~492-497) so both
test groups cover the sha256-colon parsing edge and non-localhost behavior;
ensure the new cases use the same table structure and test name pattern so the
existing test loop picks them up.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 5a15d185-3b45-4149-94e9-23bcb5234803

📥 Commits

Reviewing files that changed from the base of the PR and between 78e9e0e and b763a1a.

📒 Files selected for processing (2)
  • pkg/controller/internalreleaseimage/aggregation.go
  • pkg/controller/internalreleaseimage/internalreleaseimage_controller_test.go

The conversion of the image url from the MCN to IRI was not
being done properly. For example if the MCN had:
localhost.localdomain:22625/openshift/release-images@sha256:<id>

The resulting IRI image was
api-int.ostest.test.metalkube.org.localdomain:22625/openshift/release-images@sha256:<id>

It should not contain "localdomain".
@bfournie bfournie force-pushed the iri-image-e22-fail branch from b763a1a to 78cf83b Compare May 28, 2026 13:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@andfasano
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 28, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andfasano, bfournie

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

@bfournie
Copy link
Copy Markdown
Contributor Author

/verified by @bfournie

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@bfournie: This PR has been marked as verified by @bfournie.

Details

In response to this:

/verified by @bfournie

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-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 78e9e0e and 2 for PR HEAD 78cf83b in total

@bfournie
Copy link
Copy Markdown
Contributor Author

/test e2e-hypershift

@bfournie
Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-op-single-node

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 28, 2026

@bfournie: 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 d72b715 into openshift:main May 28, 2026
17 checks passed
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@bfournie: Jira Issue OCPBUGS-86671 is in an unrecognized state (Code Review) and will not be moved to the MODIFIED state.

Details

In response to this:

The conversion of the image url from the MCN to IRI was not being done properly. For example if the MCN had:
localhost.localdomain:22625/openshift/release-images@sha256:

The resulting IRI image was
api-int.ostest.test.metalkube.org.localdomain:22625/openshift/release-images@sha256:

It should not contain "localdomain".

- What I did

- How to verify it

- Description for the changelog

Summary by CodeRabbit

  • Bug Fixes

  • Improved internal API URL transformation to more reliably handle host:port forms (including localhost variants), reducing malformed internal endpoints.

  • Tests

  • Added table-driven unit tests covering multiple URL/host scenarios, port handling, and edge cases to ensure consistent behavior.

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.

@bfournie bfournie deleted the iri-image-e22-fail branch May 28, 2026 21:40
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants