Skip to content

[env_op_images] Fix expected_pull_basis for direct mirror URLs#3961

Open
nemarjan wants to merge 1 commit into
openstack-k8s-operators:mainfrom
nemarjan:env-op-images-mirror-prefix-fix
Open

[env_op_images] Fix expected_pull_basis for direct mirror URLs#3961
nemarjan wants to merge 1 commit into
openstack-k8s-operators:mainfrom
nemarjan:env-op-images-mirror-prefix-fix

Conversation

@nemarjan
Copy link
Copy Markdown
Contributor

The pulled-images report template only checked image references against source registry prefixes from ICSP/IDMS rules. Images already referencing a mirror URL directly (e.g. registry.stage instead of registry.redhat.io) were misclassified as "source". Add a second-pass check against mirror prefixes so these images are correctly labelled expected_pull_basis: mirror.

The pulled-images report template only checked image references
against source registry prefixes from ICSP/IDMS rules. Images
already referencing a mirror URL directly (e.g. registry.stage
instead of registry.redhat.io) were misclassified as "source".

Add a second-pass check against mirror prefixes so these images
are correctly labelled expected_pull_basis: mirror.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: nemarjan <nemarjan@redhat.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 26, 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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from nemarjan. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@nemarjan nemarjan marked this pull request as ready for review May 26, 2026 08:32
@nemarjan nemarjan requested review from Valkyrie00 and evallesp May 26, 2026 08:32
@nemarjan
Copy link
Copy Markdown
Contributor Author

The pulled-images report template only matched image references against source registry prefixes (e.g. registry.redhat.io) from ICSP/IDMS mirror rules. When an image already referenced a mirror URL directly (e.g. registry.stage.redhat.io), the startswith check against the source prefix failed because the strings differ at character 10 (s vs r). This caused the image to be incorrectly labelled expected_pull_basis: source even though it was on a known mirror. The fix adds a fallback check against mirror prefixes so these images are correctly labelled mirror.

@evallesp
Copy link
Copy Markdown
Contributor

LGTM, Can we make a test that covers this? So we don't eventually makes a regression?

@nemarjan nemarjan changed the title [env_op_images] Fix expected_pull_basis for direct mirror URLs [DNM] [env_op_images] Fix expected_pull_basis for direct mirror URLs May 29, 2026
@nemarjan nemarjan changed the title [DNM] [env_op_images] Fix expected_pull_basis for direct mirror URLs [env_op_images] Fix expected_pull_basis for direct mirror URLs May 29, 2026
Copy link
Copy Markdown
Contributor

@michburk michburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

I agree with @evallesp that some molecule tests would be good here, but considering this is a bug fix and the other core functionality of this feature isn't being tested with molecule yet, I'm ok with merging this after just seeing the testproject results.

I think a complete suite of molecule tests would be a good follow-up patch, but adding that here and now as part of this patch feels a little outside of the scope of these changes.

Open to disagreement!

@Valkyrie00
Copy link
Copy Markdown
Contributor

Valkyrie00 commented May 29, 2026

Implementation looks good to me. Regarding test, I agree with you both, but one thought for a potential follow-up. If we want to add coverage down the road, we could convert it into a Python module (following the verify_pulled_report_crio pattern) so it can be unit-tested via ansible-test. Not a blocker, just flagging it as something we could track as a separate task.

For the moment, I'm ok with this change, so I've approved it 👍

cc: @evallesp @michburk @nemarjan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants