Skip to content

OCPNODE-4554: Automate OCP-70203: ICSP and IDMS/ITMS can coexist in cluster#31229

Open
asahay19 wants to merge 1 commit into
openshift:mainfrom
asahay19:70203
Open

OCPNODE-4554: Automate OCP-70203: ICSP and IDMS/ITMS can coexist in cluster#31229
asahay19 wants to merge 1 commit into
openshift:mainfrom
asahay19:70203

Conversation

@asahay19
Copy link
Copy Markdown
Contributor

@asahay19 asahay19 commented May 28, 2026

Migrates test case OCP-70203 from openshift-tests-private to origin.
Here is the Polarion link: https://polarion.engineering.redhat.com/polarion/#/project/OSE/workitem?id=OCP-70203

The test verifies that ImageContentSourcePolicy (ICSP), ImageDigestMirrorSet (IDMS), and ImageTagMirrorSet (ITMS) can coexist on a cluster without conflicts, including validating that:

  • Creating an IDMS with the same config as an existing ICSP does not trigger a redundant MCP rollout
  • Deleting the ICSP while an equivalent IDMS is present does not alter registries.conf
  • Mixed ICSP/IDMS/ITMS configurations are correctly reflected in /etc/containers/registries.conf
  • Labeled as ote.Informing() per the Integration Guide for OpenShift Tests Extension.

PTAL @QiWang19 @cpmeadors @BhargaviGudi

Summary by CodeRabbit

  • Tests
    • Added an end-to-end test verifying that image mirror resources can coexist, that registry mirror entries (digest-only vs tag-only) appear/are removed as expected in the node registries configuration, that unnecessary configuration rollouts are avoided, and that the suite performs pre-flight cleanup and conditional deferred cleanup.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 28, 2026

@asahay19: This pull request references OCPNODE-4554 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Migrates test case OCP-70203 from openshift-tests-private to origin.
Here is the Polarion link: https://polarion.engineering.redhat.com/polarion/#/project/OSE/workitem?id=OCP-70203

The test verifies that ImageContentSourcePolicy (ICSP), ImageDigestMirrorSet (IDMS), and ImageTagMirrorSet (ITMS) can coexist on a cluster without conflicts, including validating that:

  • Creating an IDMS with the same config as an existing ICSP does not trigger a redundant MCP rollout
  • Deleting the ICSP while an equivalent IDMS is present does not alter registries.conf
  • Mixed ICSP/IDMS/ITMS configurations are correctly reflected in /etc/containers/registries.conf
  • Labeled as ote.Informing() per the Integration Guide for OpenShift Tests Extension.

PTAL @QiWang19 @cpmeadors @BhargaviGudi

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d2f0920e-232e-442f-bda6-707779e9fdb8

📥 Commits

Reviewing files that changed from the base of the PR and between f21983b and 4eaf866.

📒 Files selected for processing (1)
  • test/extended/node/node_e2e/node.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/node/node_e2e/node.go

Walkthrough

This pull request adds a comprehensive end-to-end Ginkgo test that validates how ICSP, IDMS, and ITMS resources coexist in a cluster and affect MCP rollouts and /etc/containers/registries.conf configuration. The test sequences resource creation and deletion to verify precedence behavior and stability across different mirror policy types.

Changes

ICSP/IDMS/ITMS Coexistence and Precedence E2E Test

Layer / File(s) Summary
Test infrastructure and setup
test/extended/node/node_e2e/node.go
Adds Ginkgo informing wrapper import, declares the e2e test with pre-flight cleanup of stale ICSP/IDMS/ITMS resources, validates MCP stability, and defines deferred cleanup logic to conditionally settle MCP rollouts when resources are deleted.
ICSP digest mirror creation and registries.conf validation
test/extended/node/node_e2e/node.go
Creates initial ICSP with digest mirrors, records baseline MCP spec configuration names, waits for MCP rollout, and validates /etc/containers/registries.conf on a worker node contains the expected ICSP source/mirror entries with pull-from-mirror = digest-only.
IDMS coexistence and MCP precedence
test/extended/node/node_e2e/node.go
Creates IDMS using identical source/mirror configuration as the initial ICSP and verifies no new MCP generation, then deletes the ICSP and confirms MCP remains stable and registries.conf unchanged because IDMS still provides the same mirror config.
ITMS tag mirror validation and integration
test/extended/node/node_e2e/node.go
Creates ITMS with a different source/mirror configuration, waits for MCP rollout, and validates registries.conf is updated to include tag-only mirror entries while preserving the digest-only entries from the existing IDMS.
Multi-policy coexistence and deletion effects
test/extended/node/node_e2e/node.go
Creates a second ICSP and validates registries.conf contains the new digest-only entries alongside existing IDMS and ITMS entries, then deletes the IDMS and verifies registries.conf no longer contains the deleted IDMS sources while retaining ITMS and ICSP2 entries.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Test violates single responsibility principle with 16 g.By steps testing unrelated behaviors (ICSP/IDMS/ITMS creation, deletion, MCP updates), and line 371 has an assertion without a failure message. Split test into focused tests: one for ICSP/IDMS coexistence without rollout, one for mixed ICSP/IDMS/ITMS, one for deletion cleanup. Add error message to line 371 assertion: Expect(mcpErr).NotTo(HaveOccurred(), "failed to get MCP status")
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning Test assumes multi-node clusters: calls GetFirstReadyWorkerNode() expecting worker nodes with node-role.kubernetes.io/worker label; expects separate "worker" and "master" MCP pools; will fail on SNO. Add [Skipped:SingleReplicaTopology] label to test name, OR add exutil.IsSingleNode() check with g.Skip() at test start, OR add infrastructure topology check skipping on SingleReplicaTopologyMode.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically summarizes the main change: automating a test case (OCP-70203) that validates ICSP and IDMS/ITMS coexistence, which directly aligns with the changeset's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Test title "[OTP] ICSP and IDMS/ITMS can coexist in cluster [OCP-70203]" is static and deterministic with no dynamic content. All g.By() statements are also static.
Microshift Test Compatibility ✅ Passed Test is wrapped in parent Describe with BeforeEach containing exutil.IsMicroShiftCluster() check that skips on MicroShift, protecting from all unavailable OpenShift APIs.
Topology-Aware Scheduling Compatibility ✅ Passed PR adds only an e2e test file. The topology check applies to "deployment manifests, operator code, or controllers," not test infrastructure.
Ote Binary Stdout Contract ✅ Passed New test in node.go passes OTE binary stdout contract: no init/main functions, all logging via e2e.Logf within test blocks, no klog or unmanaged log writes to stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Test at lines 314-656 contains no IPv4 assumptions, hardcoded IPv4 addresses, IPv4 localhost references, IP parsing, or external connectivity requirements. Uses cluster-internal operations only.
No-Weak-Crypto ✅ Passed No weak cryptographic algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret comparisons found in the added test code.
Container-Privileges ✅ Passed PR adds e2e test for ICSP/IDMS/ITMS coexistence without any privileged container configurations (no privileged:true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation:true found).
No-Sensitive-Data-In-Logs ✅ Passed New test logs only resource names and byte counts, never secrets. Registries.conf content is not logged. Test data uses example registries without credentials.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 28, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: asahay19
Once this PR has been reviewed and has the lgtm label, please assign mrunalp 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

@openshift-ci openshift-ci Bot requested review from BhargaviGudi and mrunalp May 28, 2026 09:00
Copy link
Copy Markdown

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 455-457: The test currently logs the full registries.conf content
(registriesConf) using e2e.Logf after reading it via
nodeutils.ExecOnNodeWithChroot, which may leak internal hostnames or customer
data; change the logging to either redact hostnames/URLs or extract and log only
the specific entries asserted on (e.g., mirror hostnames or the presence/absence
of keys) instead of printing registriesConf wholesale, and apply the same change
for the other occurrences noted (around the code that reads/prints
registries.conf at the other locations).
- Around line 354-359: The MCP baseline config names must be captured before
issuing stale-resource deletions: move the calls to
imagepolicy.GetMCPCurrentSpecConfigName(oc, "worker") and
imagepolicy.GetMCPCurrentSpecConfigName(oc, "master") to before the deletion
logic so that the variables (e.g., staleWorkerSpec, staleMasterSpec) hold the
pre-change spec; then call imagepolicy.WaitForMCPConfigSpecChangeAndUpdated(oc,
"worker", staleWorkerSpec) and
imagepolicy.WaitForMCPConfigSpecChangeAndUpdated(oc, "master", staleMasterSpec)
after deletions to wait for the post-change update.
- Around line 472-520: The current no-rollout checks only take a single worker
MCP snapshot (using imagepolicy.GetMCPCurrentSpecConfigName) after sleeping,
which can miss delayed renders or master-only changes; replace these checks with
polling over the observation window (instead of time.Sleep) and verify both
worker and master MCP spec/status names remain equal to the pre-change values
(specBeforeIDMS/specAfterIDMS and specBeforeICSPDelete/specAfterICSPDelete) for
the entire window; use a polling helper (e.g., wait.PollImmediate or test
framework wait) to repeatedly call imagepolicy.GetMCPCurrentSpecConfigName for
"worker" and "master" and assert they never deviate from the corresponding
specBefore values before concluding the test.
- Around line 325-353: The pre-flight cleanup currently deletes ICSP/IDMS by
matching on RepositoryDigestMirrors/ImageDigestMirrors Source values, which can
remove unrelated cluster objects and misses ImageTagMirrorSets (ITMS); change
the logic in the node.go pre-flight block to instead target only test-owned
resources (e.g., check for a test-specific name prefix or a label you set on
created objects) when iterating operatorClient.ImageContentSourcePolicies().List
and configClient.ImageDigestMirrorSets().List, and add an analogous loop for
configClient.ImageTagMirrorSets().List to remove stale ITMS—use the same
test-owned selector (name prefix or label) to decide deletion, set staleCleaned
accordingly, and avoid deleting objects based solely on their Source fields.
- Around line 334-348: The pre-flight cleanup currently discards errors from
operatorClient.ImageContentSourcePolicies().Delete and
configClient.ImageDigestMirrorSets().Delete and sets staleCleaned = true
unconditionally; change each delete call to capture the returned error (err :=
...Delete(ctx, name, metav1.DeleteOptions{})), check it, and only set
staleCleaned = true when err == nil; on error, log the failure with context
(e.g., using e2e.Logf) and/or assert via o.Expect(err).NotTo(o.HaveOccurred(),
...) so API/auth failures are surfaced instead of swallowed for both the ICSP
deletion path (referencing icsp.Name, rdm.Source, staleCleaned) and the IDMS
deletion loop (referencing idms.Name, dim.Source, existingIDMSs).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 188eb55b-d42e-43a5-8f01-7bd434fd2a9f

📥 Commits

Reviewing files that changed from the base of the PR and between a29f970 and f21983b.

📒 Files selected for processing (1)
  • test/extended/node/node_e2e/node.go

Comment thread test/extended/node/node_e2e/node.go Outdated
Comment thread test/extended/node/node_e2e/node.go Outdated
Comment thread test/extended/node/node_e2e/node.go
Comment thread test/extended/node/node_e2e/node.go Outdated
Comment thread test/extended/node/node_e2e/node.go Outdated
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label May 28, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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

openshift-ci Bot commented May 28, 2026

@asahay19: The following test 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-serial-1of2 4eaf866 link true /test e2e-aws-ovn-serial-1of2

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.

})

//author: asahay@redhat.com
g.It("[OTP] ICSP and IDMS/ITMS can coexist in cluster [OCP-70203]", ote.Informing(), func() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move this to a different file in the same folder?

@ngopalak-redhat
Copy link
Copy Markdown
Contributor

@asahay19 Can you point me to the log containing the test result in the CI? I'm interested to see how long this test takes to run.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants