CNTRLPLANE-1894: Add multiarch validation test for override images - #7674
CNTRLPLANE-1894: Add multiarch validation test for override images#7674hypershift-jira-solve-ci[bot] wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@hypershift-jira-solve-ci[bot]: This pull request references CNTRLPLANE-1894 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 either version "4.22." or "openshift-4.22.", but it targets "openshift-4.21" instead. DetailsIn response to this:
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. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
/auto-cc |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hypershift-jira-solve-ci[bot] 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 |
|
Hi @hypershift-jira-solve-ci[bot]. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
| return architectures, nil | ||
| } | ||
|
|
||
| func TestCollectUniqueOverrideImages(t *testing.T) { |
There was a problem hiding this comment.
How is this unit test even helpful? It doesn't seem helpful to me when considering the Jira ticket you are trying to solve.
If this is a helpful unit test, please provide empirical evidence as to why it is.
There was a problem hiding this comment.
You're right — this unit test for collectUniqueOverrideImages doesn't directly validate what CNTRLPLANE-1894 is about. The Jira ticket calls for validating that override images have multiarch support (amd64 + arm64), which is what TestOverrideImagesHaveMultiarchSupport does. This helper test only exercises a trivial deduplication function and doesn't provide meaningful regression protection or empirical value beyond what the integration test already covers.
I'll remove these helper unit tests (TestCollectUniqueOverrideImages, TestCollectUniqueOverrideImagesWithNilPlatform, TestCollectUniqueOverrideImagesTrimsWhitespace) and keep the focus on what the ticket actually requires.
AI-assisted response via Claude Code
| )) | ||
| } | ||
|
|
||
| func TestCollectUniqueOverrideImagesWithNilPlatform(t *testing.T) { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Agreed — same reasoning applies here. Will remove this test along with the others.
AI-assisted response via Claude Code
| g.Expect(images[0]).To(Equal("quay.io/example/image@sha256:abc")) | ||
| } | ||
|
|
||
| func TestCollectUniqueOverrideImagesTrimsWhitespace(t *testing.T) { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Agreed — same reasoning applies here. Will remove this test along with the others.
AI-assisted response via Claude Code
|
hypershift-jira-solve-ci - Did you try to test this? You should be able to trigger the pj-rehearse job from openshift/release here on this PR. You can look at our docs in the hypershift repo if you need more context on how to do this. |
|
/ok-to-test |
|
@hypershift-jira-solve-ci[bot]: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@bryan-cox Thank you for the feedback. No, the pj-rehearse job was not triggered from openshift/release for this PR. The unit tests were validated locally with I've also removed the three helper unit tests ( Will push the updated commit shortly after verifying the changes pass locally. AI-assisted response via Claude Code |
Override images need to support both AMD64 and ARM64 architectures to work across different platforms. Currently, there's no automated validation to ensure override images contain both architectures in their manifest lists. This test catches misconfigured images early before deployment. The test: - Parses overrides.yaml to extract all unique CPO image references - Uses skopeo to inspect each image's manifest list - Validates that each image has at least amd64 and arm64 architectures - Skips gracefully if skopeo is not installed (safe for local dev) - Reports clear per-image errors for any missing architectures Ref: CNTRLPLANE-1894 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f8721fe to
de4cb10
Compare
|
@bryan-cox Update: The helper unit tests have been removed and the updated commit has been pushed. The remaining tests ( Regarding testing via AI-assisted response via Claude Code |
|
Closing PR - reverting Jira ticket to backlog |
|
/close |
|
@bryan-cox: Closed this PR. DetailsIn response to this:
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. |
What this PR does / why we need it:
Adds a Go test to validate that all CPO override images referenced in
overrides.yamlhave multiarch support (at least amd64 and arm64 architectures in their manifest lists).Override images need to support both AMD64 and ARM64 architectures to work across different platforms. Currently, there's no automated validation to ensure override images contain both architectures. This test catches misconfigured images early before deployment.
How it works:
overrides.yamlto extract all unique CPO image references (deduplicated)skopeo inspect --rawto fetch each image's manifestskopeois not installed (safe for localmake test)Unit tests included:
TestCollectUniqueOverrideImages- validates image deduplication across platformsTestCollectUniqueOverrideImagesWithNilPlatform- handles nil platform configsTestCollectUniqueOverrideImagesTrimsWhitespace- handles trailing whitespace in YAMLTestParseMultiarchManifest- validates multiarch manifest parsingTestParseSingleArchManifest- validates single-arch detectionTestOverrideImagesHaveMultiarchSupport- integration test (requires skopeo)Which issue(s) this PR fixes:
Fixes CNTRLPLANE-1894
Special notes for your reviewer:
TestOverrideImagesHaveMultiarchSupporttest requiresskopeoto be installed. It will skip gracefully when skopeo is not available.run_if_changed: (/overrides\.yaml$)would be a follow-up in theopenshift/releaserepository.Checklist:
🤖 Generated with Claude Code via
/jira-solve [CNTRLPLANE-1894](https://issues.redhat.com//browse/CNTRLPLANE-1894) originAlways review AI generated responses prior to use.