Skip to content

AGENT-1426: Add localhost mirror only when missing in IRI patcher#10028

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
danielerez:agent-1426-iri-localhost-only-if-missing
Mar 25, 2026
Merged

AGENT-1426: Add localhost mirror only when missing in IRI patcher#10028
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
danielerez:agent-1426-iri-localhost-only-if-missing

Conversation

@danielerez
Copy link
Contributor

When patching ImageDigestMirrorSet and ImageTagMirrorSet for InternalReleaseImage, append the localhost mirror only if the mirror set does not already contain a localhost entry (to avoid duplication).

This is required for: openshift/appliance#645 I.e. The appliance should use 'localhost', thus, already adding it to mirrors.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf7f578e-aa5e-4570-8fbb-4f07d14cd682

📥 Commits

Reviewing files that changed from the base of the PR and between 0292c41 and a98d019.

📒 Files selected for processing (2)
  • internal/ignition/internalreleaseimage_patcher.go
  • internal/ignition/internalreleaseimage_patcher_test.go

Walkthrough

Added helper functions to detect whether an ImageMirror already targets localhost, and updated PatchManifests for both IDMS and ITMS to conditionally append localhost mirror entries only when not already present, while always appending api-int-patched entries. Comprehensive test coverage was added.

Changes

Cohort / File(s) Summary
Mirror Detection and Conditional Patching
internal/ignition/internalreleaseimage_patcher.go
Added mirrorHasLocalhost and mirrorsContainLocalhost helper functions to detect localhost targets (with or without port/path). Updated PatchManifests to conditionally append localhost mirror entries only when the original mirrors do not already contain a localhost entry, while always appending api-int-patched entries.
Mirror Detection and Patching Tests
internal/ignition/internalreleaseimage_patcher_test.go
Added test specs validating localhost detection across various forms (no path, with port, with port/path) and non-localhost hosts. Added test case verifying PatchManifests does not add duplicate localhost mirrors to IDMS/ITMS when they already contain localhost entries. Included helper functions for base64-decoding and unmarshaling IDMS/ITMS manifests, plus fixture manifests with existing localhost mirrors.

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.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

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

openshift-ci-robot commented Mar 19, 2026

@danielerez: This pull request references AGENT-1426 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 task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

When patching ImageDigestMirrorSet and ImageTagMirrorSet for InternalReleaseImage, append the localhost mirror only if the mirror set does not already contain a localhost entry (to avoid duplication).

This is required for: openshift/appliance#645 I.e. The appliance should use 'localhost', thus, already adding it to mirrors.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 19, 2026
@danielerez
Copy link
Contributor Author

/test ?

@danielerez
Copy link
Contributor Author

/test e2e-agent-compact-ipv4-iso-no-registry

When patching ImageDigestMirrorSet and ImageTagMirrorSet for InternalReleaseImage,
append the localhost mirror only if the mirror set does not already contain a
localhost entry (to avoid duplication).

This is required for: openshift/appliance#645
I.e. The appliance should use 'localhost', thus, already adding it to mirrors.
@danielerez danielerez force-pushed the agent-1426-iri-localhost-only-if-missing branch from ac94194 to a98d019 Compare March 19, 2026 19:33
@danielerez danielerez marked this pull request as ready for review March 22, 2026 08:15
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 22, 2026
@danielerez
Copy link
Contributor Author

/cc @andfasano

@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.49%. Comparing base (0292c41) to head (a98d019).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10028      +/-   ##
==========================================
+ Coverage   44.09%   45.49%   +1.40%     
==========================================
  Files         415      415              
  Lines       72258    74599    +2341     
==========================================
+ Hits        31860    33939    +2079     
- Misses      37518    37756     +238     
- Partials     2880     2904      +24     
Files with missing lines Coverage Δ
internal/ignition/internalreleaseimage_patcher.go 67.41% <100.00%> (+2.17%) ⬆️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@omer-vishlitzky
Copy link
Contributor

/retest

@omer-vishlitzky
Copy link
Contributor

/lgtm
/approve

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

openshift-ci bot commented Mar 24, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielerez, omer-vishlitzky

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 [danielerez,omer-vishlitzky]

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

@omer-vishlitzky
Copy link
Contributor

/retest

@danielerez
Copy link
Contributor Author

/override ci/prow/edge-e2e-ai-operator-ztp

@openshift-ci
Copy link

openshift-ci bot commented Mar 25, 2026

@danielerez: Overrode contexts on behalf of danielerez: ci/prow/edge-e2e-ai-operator-ztp

Details

In response to this:

/override ci/prow/edge-e2e-ai-operator-ztp

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.

@danielerez
Copy link
Contributor Author

/override ci/prow/e2e-agent-compact-ipv4-iso-no-registry

@openshift-ci
Copy link

openshift-ci bot commented Mar 25, 2026

@danielerez: Overrode contexts on behalf of danielerez: ci/prow/e2e-agent-compact-ipv4-iso-no-registry

Details

In response to this:

/override ci/prow/e2e-agent-compact-ipv4-iso-no-registry

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-bot openshift-merge-bot bot merged commit 6989bc2 into openshift:master Mar 25, 2026
20 of 21 checks passed
@openshift-ci
Copy link

openshift-ci bot commented Mar 25, 2026

@danielerez: 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.

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants