[env_op_images] Fix expected_pull_basis for direct mirror URLs#3961
[env_op_images] Fix expected_pull_basis for direct mirror URLs#3961nemarjan wants to merge 1 commit into
Conversation
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>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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. |
|
LGTM, Can we make a test that covers this? So we don't eventually makes a regression? |
michburk
left a comment
There was a problem hiding this comment.
/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!
|
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 👍 |
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.