Skip to content

OCPBUGS-61465: Updated openshift-tests images to utilize mapped images from external binary#30873

Open
jubittajohn wants to merge 2 commits intoopenshift:mainfrom
jubittajohn:ot-images
Open

OCPBUGS-61465: Updated openshift-tests images to utilize mapped images from external binary#30873
jubittajohn wants to merge 2 commits intoopenshift:mainfrom
jubittajohn:ot-images

Conversation

@jubittajohn
Copy link
Contributor

@jubittajohn jubittajohn commented Mar 12, 2026

Updated openshift-tests images to utilize mapped images from external binary

Summary by CodeRabbit

Release Notes

  • Refactor
    • Rewrote the image mirroring flow to support multiple image sets with enhanced mapping and conditional logic based on external test configuration.
    • Added exception-based filtering for image handling and improved processing of external image binary results.
    • Updated image list handling to streamline conversion and filtering of image configurations across vendored and external sources.

Signed-off-by: jubittajohn <jujohn@redhat.com>
… binary

Signed-off-by: jubittajohn <jujohn@redhat.com>
@openshift-ci-robot
Copy link

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: automatic mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 12, 2026
@openshift-ci-robot
Copy link

@jubittajohn: This pull request references Jira Issue OCPBUGS-61465, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.z" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Updated openshift-tests images to utilize mapped images from external binary

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
Copy link
Contributor

openshift-ci bot commented Mar 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jubittajohn
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. 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

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Walkthrough

The changes refactor the image handling pipeline by updating the extension binary interface to return raw image data directly ([]extension.Image) instead of constructed ImageSets. The command layer is modified to handle multiple image set configurations with exception filtering and conditional branching based on the OPENSHIFT_SKIP_EXTERNAL_TESTS flag.

Changes

Cohort / File(s) Summary
Binary Interface Update
pkg/test/extensions/binary.go
Method signatures for TestBinary.ListImages() and TestBinaries.ListImages() changed to return []extension.Image instead of ImageSet/[]ImageSet. Internal accumulation logic updated to propagate raw image slices directly rather than constructing ImageSets.
Image Command Refactoring
pkg/cmd/openshift-tests/images/images_command.go
Rewrites image mirroring flow to initialize multiple image sets (defaultImageSets, updatedImageSets), adds exception filtering logic, introduces conditional branching based on OPENSHIFT_SKIP_EXTERNAL_TESTS flag for deriving images from vendored tests or external binaries, and refactors final mirror lines generation to consider both updated mappings and OpenShift defaults.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: it updates openshift-tests images to utilize mapped images from external binaries, which aligns with the primary modifications across both files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Stable And Deterministic Test Names ✅ Passed Modified files contain utility and command logic code, not Ginkgo test definitions with dynamic test names.
Test Structure And Quality ✅ Passed This PR does not contain any Ginkgo test code modifications, only implementation and utility files.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@openshift-ci openshift-ci bot requested review from deads2k and sjenning March 12, 2026 19:35
@jubittajohn
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 12, 2026
@openshift-ci-robot
Copy link

@jubittajohn: This pull request references Jira Issue OCPBUGS-61465, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @wangke19

Details

In response to this:

/jira refresh

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 requested a review from wangke19 March 12, 2026 19:35
Copy link

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/cmd/openshift-tests/images/images_command.go`:
- Around line 190-210: The issue is that defaultImageSets and updatedImageSets
can diverge because when image.Mapped is nil you append to defaultImageSets but
skip updatedImageSets; fix by always appending an entry to updatedImageSets for
each defaultImageSets entry: inside the loop over imagesFromBinaries (the block
that builds initialSet/defaultImageSets), create a mappedConfig variable set to
convertImageToImageConfig(*image.Mapped) when image.Mapped != nil otherwise
fallback to origImageConfig, then always append extensions.ImageSet{imageID:
mappedConfig} to updatedImageSets so indexes of defaultImageSets and
updatedImageSets remain aligned for later iteration over updatedImageSets.

In `@pkg/test/extensions/binary.go`:
- Around line 759-765: In the loop calling binary.ListImages, after sending the
error to errCh you must immediately skip further processing for that iteration
(add a continue) so you don't append a potentially empty/invalid images slice;
update the block referencing binary.ListImages, errCh, images, allImages and mu
to send the error then continue. Also apply the same fix to the analogous error
handling in ListTests (the block around ListTests/errCh/images at lines
~824-826) so both places consistently return to the loop after reporting errors.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: f6bebf10-e522-4ab1-a986-c8981f1a086c

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd854e and 47b3556.

📒 Files selected for processing (2)
  • pkg/cmd/openshift-tests/images/images_command.go
  • pkg/test/extensions/binary.go

Comment on lines +190 to 210
for _, image := range imagesFromBinaries {
// Add original image
imageID := k8simage.ImageID(image.Index)
origImageConfig := convertImageToImageConfig(image)

initialSet := extensions.ImageSet{imageID: origImageConfig}
initialImageSets = append(initialImageSets, initialSet)

// Only add to default and mapped if original image passes exceptions
if !imageMatchesExceptions(origImageConfig, exceptions) {
defaultImageSets = append(defaultImageSets, initialSet)

if image.Mapped != nil {
mappedSet := extensions.ImageSet{
imageID: convertImageToImageConfig(*image.Mapped),
}
updatedImageSets = append(updatedImageSets, mappedSet)
}
}
}
if len(filtered) > 0 {
defaultImageSets = append(defaultImageSets, filtered)
}
}

// Created a new slice with the updatedImageSets addresses for the images
updatedImageSets := []extensions.ImageSet{}
for i := range defaultImageSets {
updatedImageSets = append(updatedImageSets, k8simage.GetMappedImageConfigs(defaultImageSets[i], ref.Exact()))
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Potential index mismatch between defaultImageSets and updatedImageSets.

When image.Mapped is nil (Line 202), the image is added to defaultImageSets but not to updatedImageSets. This creates a size mismatch between the two slices.

Later at Lines 270-272, the code iterates over updatedImageSets using index i and accesses defaultImageSets[i][imageID]:

for i := range updatedImageSets {
    for imageID := range updatedImageSets[i] {
        a, b := defaultImageSets[i][imageID], updatedImageSets[i][imageID]

If defaultImageSets has more entries than updatedImageSets (because some images lack Mapped data), accessing defaultImageSets[i] won't correspond to the correct original image for updatedImageSets[i].

Consider either:

  1. Always adding an entry to updatedImageSets (using the original config as a fallback when Mapped is nil), or
  2. Using a different data structure that maintains the relationship between original and mapped images.
Proposed fix: Always populate updatedImageSets
 			// Only add to default and mapped if original image passes exceptions
 			if !imageMatchesExceptions(origImageConfig, exceptions) {
 				defaultImageSets = append(defaultImageSets, initialSet)
 
 				if image.Mapped != nil {
 					mappedSet := extensions.ImageSet{
 						imageID: convertImageToImageConfig(*image.Mapped),
 					}
 					updatedImageSets = append(updatedImageSets, mappedSet)
+				} else {
+					// Use original config as fallback when no mapping exists
+					updatedImageSets = append(updatedImageSets, initialSet)
 				}
 			}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/cmd/openshift-tests/images/images_command.go` around lines 190 - 210, The
issue is that defaultImageSets and updatedImageSets can diverge because when
image.Mapped is nil you append to defaultImageSets but skip updatedImageSets;
fix by always appending an entry to updatedImageSets for each defaultImageSets
entry: inside the loop over imagesFromBinaries (the block that builds
initialSet/defaultImageSets), create a mappedConfig variable set to
convertImageToImageConfig(*image.Mapped) when image.Mapped != nil otherwise
fallback to origImageConfig, then always append extensions.ImageSet{imageID:
mappedConfig} to updatedImageSets so indexes of defaultImageSets and
updatedImageSets remain aligned for later iteration over updatedImageSets.

Comment on lines +759 to 765
images, err := binary.ListImages(ctx)
if err != nil {
errCh <- err
}
mu.Lock()
allImages = append(allImages, imageConfig)
allImages = append(allImages, images...)
mu.Unlock()
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing continue after error handling.

When ListImages returns an error, the error is sent to errCh, but execution continues to append the (likely empty) images slice. Consider adding a continue statement after sending the error to errCh for cleaner control flow, consistent with typical error-then-continue patterns.

Note: The same pattern exists at Line 824-826 in ListTests, so this appears to be a pre-existing pattern in this file.

Proposed fix
 				images, err := binary.ListImages(ctx)
 				if err != nil {
 					errCh <- err
+					continue
 				}
 				mu.Lock()
 				allImages = append(allImages, images...)
 				mu.Unlock()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
images, err := binary.ListImages(ctx)
if err != nil {
errCh <- err
}
mu.Lock()
allImages = append(allImages, imageConfig)
allImages = append(allImages, images...)
mu.Unlock()
images, err := binary.ListImages(ctx)
if err != nil {
errCh <- err
continue
}
mu.Lock()
allImages = append(allImages, images...)
mu.Unlock()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/extensions/binary.go` around lines 759 - 765, In the loop calling
binary.ListImages, after sending the error to errCh you must immediately skip
further processing for that iteration (add a continue) so you don't append a
potentially empty/invalid images slice; update the block referencing
binary.ListImages, errCh, images, allImages and mu to send the error then
continue. Also apply the same fix to the analogous error handling in ListTests
(the block around ListTests/errCh/images at lines ~824-826) so both places
consistently return to the loop after reporting errors.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 13, 2026

@jubittajohn: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-microshift 47b3556 link true /test e2e-aws-ovn-microshift
ci/prow/e2e-metal-ipi-ovn-ipv6 47b3556 link true /test e2e-metal-ipi-ovn-ipv6

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants