Skip to content

MCO-2025: OCP-88366 and add OCP-88814 for osImageStream with osImageURL#6014

Open
HarshwardhanPatil07 wants to merge 7 commits intoopenshift:mainfrom
HarshwardhanPatil07:migrate-test-ocp-88366
Open

MCO-2025: OCP-88366 and add OCP-88814 for osImageStream with osImageURL#6014
HarshwardhanPatil07 wants to merge 7 commits intoopenshift:mainfrom
HarshwardhanPatil07:migrate-test-ocp-88366

Conversation

@HarshwardhanPatil07
Copy link
Copy Markdown
Contributor

@HarshwardhanPatil07 HarshwardhanPatil07 commented May 7, 2026

Migrated from openshift-tests-private PR #29780. Verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering update-in-progress, post-update, and degraded-pool scenarios.

- What I did

  • Added new test

- How to verify it

- Description for the changelog

  • Migrate test OCP-88366 from openshift-tests-private (PR #29780) to machine-config-operator. The test verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering three scenarios: during MCP update, after update completion, and when the pool is degraded with an invalid MachineConfig.

Summary by CodeRabbit

  • Tests
    • Added two (skipped/disconnected) tests for OS image stream behavior: one verifies the osImageStream status is cleared when a custom OS image is applied and the node boots the custom image; the other verifies an invalid OS image entry degrades the pool, clears osImageStream while degraded, then recovers to the expected status after removal.

… is set

Migrated from openshift-tests-private PR #29780. Verifies that
status.osImageStream is not reported in the worker MCP when a custom
osImageURL is configured, covering update-in-progress, post-update,
and degraded-pool scenarios.

Signed-off-by: HarshwardhanPatil07 <harshpat@redhat.com>
@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: LGTM mode

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@HarshwardhanPatil07: No Jira issue with key OCP-88366 exists in the tracker at https://redhat.atlassian.net.
Once a valid jira issue is referenced in the title of this pull request, request a refresh with /jira refresh.

Details

In response to this:

Migrated from openshift-tests-private PR #29780. Verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering update-in-progress, post-update, and degraded-pool scenarios.

- What I did

  • Added new test

- How to verify it

- Description for the changelog

  • Migrate test OCP-88366 from openshift-tests-private (PR #29780) to machine-config-operator. The test verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering three scenarios: during MCP update, after update completion, and when the pool is degraded with an invalid MachineConfig.

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 7, 2026

Warning

Rate limit exceeded

@HarshwardhanPatil07 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: f35fc023-c0af-4d17-8dd3-6af7fbb81163

📥 Commits

Reviewing files that changed from the base of the PR and between b0f9661 and 8f31748.

📒 Files selected for processing (1)
  • test/extended-priv/mco_osimagestream.go

Walkthrough

Adds two skipped Ginkgo tests validating MCP status.osImageStream behavior when osImageURL is set or invalid, and updates the MCP status accessor to read .status.osImageStream.name instead of .status.osImageStream.

Changes

osImageStream tests + MCP status accessor

Layer / File(s) Summary
Data Shape
test/extended-priv/..., test/extended-priv/machineconfigpool.go
MCP status.osImageStream is accessed via its name field (.status.osImageStream.name) rather than the whole osImageStream object.
Accessor / Core
test/extended-priv/machineconfigpool.go
MachineConfigPool.GetStatusOsImageStream() changed to return .status.osImageStream.name instead of .status.osImageStream.
Tests / Integration
test/extended-priv/mco_osimagestream.go
Adds two skipped [Skipped:Disconnected] Ginkgo tests: (1) osImageStream should be empty when osImageURL is set — verifies CRD, initial rhel-9 status, builds custom OS image, applies MachineConfig with OS_IMAGE digest, asserts status.osImageStream is empty during update and after completion, and confirms node boots the custom image; (2) Invalid osImageURL degrades MCP and clears osImageStream status — verifies CRD and initial status, applies invalid OS_IMAGE, waits for degraded MCP while asserting status.osImageStream is empty, deletes invalid MachineConfig, and confirms recovery to rhel-9.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Compilation error: o.Expect(mcp.GetStatusOsImageStream()) tries to pass (string, error) tuple to o.Expect() which expects single value. Lines 281, 292, 348 in mco_osimagestream.go. Fix error handling for GetStatusOsImageStream() calls. Capture error separately before assertion, e.g.: statusVal, err := mcp.GetStatusOsImageStream(); o.Expect(err).NotTo(HaveOccurred()); o.Expect(statusVal).To(BeEmpty())
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning Tests lack SNO compatibility protection. While functionally compatible with SNO via GetCompactCompatiblePool, they have no [Skipped:SingleReplicaTopology] label or SNO skip checks. Add [Skipped:SingleReplicaTopology] to test names if excluding SNO, or add exutil.IsSingleNode() check with g.Skip() if intentionally designed for SNO only.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the Polarion/OCP issue IDs (OCP-88366 and OCP-88814) that correspond to the test cases added, and accurately describes the primary change: adding tests for osImageStream behavior with osImageURL.
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 Both new test names (88366 and 88814) are stable. They contain only static, descriptive text with no dynamic values, timestamps, or generated identifiers.
Microshift Test Compatibility ✅ Passed Both tests have [apigroup:machineconfiguration.openshift.io] tags. This API is unavailable on MicroShift, and MicroShift CI automatically skips tests with unsupported apigroup tags.
Topology-Aware Scheduling Compatibility ✅ Passed The PR modifies only test files in test/extended-priv/. The check applies to deployment manifests, operator code, and controllers, not test code.
Ote Binary Stdout Contract ✅ Passed No OTE Stdout Contract violations. All new tests are in g.It() blocks, no process-level stdout writes, and logging uses ginkgo.GinkgoWriter.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Both new tests are marked [Skipped:Disconnected]. No IPv4 hardcoding or external connectivity issues detected beyond what's already mitigated by the skip label.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 openshift-ci Bot requested review from pablintino and umohnani8 May 7, 2026 10:09
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@HarshwardhanPatil07: No Jira issue with key OCP-88366 exists in the tracker at https://redhat.atlassian.net.
Once a valid jira issue is referenced in the title of this pull request, request a refresh with /jira refresh.

Details

In response to this:

Migrated from openshift-tests-private PR #29780. Verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering update-in-progress, post-update, and degraded-pool scenarios.

- What I did

  • Added new test

- How to verify it

- Description for the changelog

  • Migrate test OCP-88366 from openshift-tests-private (PR #29780) to machine-config-operator. The test verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering three scenarios: during MCP update, after update completion, and when the pool is degraded with an invalid MachineConfig.

Summary by CodeRabbit

  • Tests
  • Added test case to verify osImageStream status behavior when custom OS images are configured, covering pool updating, completion, and degradation states.

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.

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

🤖 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-priv/mco_osimagestream.go`:
- Around line 238-246: The test degrades an MCP but only defers
degradedMC.DeleteWithWait(), which removes the bad MachineConfig but doesn't
wait for the pool to reconcile; add a defer call to mcp.waitForComplete()
(registered before the spec restore/deletion so it runs last, e.g. defer
mcp.waitForComplete() then defer mcp.SetSpec(mcp.GetSpecOrFail()) / defer
degradedMC.DeleteWithWait()) to ensure the MCP pool has returned to healthy
state before teardown completes.
- Around line 279-285: The test has a race because mcp.GetUpdatingStatus is
polled with Eventually and then mcp.GetStatusOsImageStream is checked once with
Expect; the MCP may leave Updating=True before that single check. Replace the
two-step check by polling both conditions atomically inside a single Eventually
call (e.g., pass a closure that reads mcp.GetUpdatingStatus and
mcp.GetStatusOsImageStream and returns a boolean/error) and assert that Updating
== True AND status.osImageStream is empty within the same poll; update the code
that currently calls Eventually(mcp.GetUpdatingStatus) and
Expect(mcp.GetStatusOsImageStream()) to use this single Eventually that verifies
both conditions together.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 52c4fd72-9001-4247-98e7-3f2374e4b4fb

📥 Commits

Reviewing files that changed from the base of the PR and between 66df1c1 and 331c00b.

📒 Files selected for processing (1)
  • test/extended-priv/mco_osimagestream.go

Comment thread test/extended-priv/mco_osimagestream.go Outdated
Comment thread test/extended-priv/mco_osimagestream.go
The jsonpath was returning the entire osImageStream struct as JSON
(e.g. {"name":"rhel-9"}) instead of just the name string ("rhel-9"),
causing BeEmpty() assertions to fail when the field was absent but
the struct was serialized as an empty object.
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@HarshwardhanPatil07: No Jira issue with key OCP-88366 exists in the tracker at https://redhat.atlassian.net.
Once a valid jira issue is referenced in the title of this pull request, request a refresh with /jira refresh.

Details

In response to this:

Migrated from openshift-tests-private PR #29780. Verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering update-in-progress, post-update, and degraded-pool scenarios.

- What I did

  • Added new test

- How to verify it

- Description for the changelog

  • Migrate test OCP-88366 from openshift-tests-private (PR #29780) to machine-config-operator. The test verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering three scenarios: during MCP update, after update completion, and when the pool is degraded with an invalid MachineConfig.

Summary by CodeRabbit

  • Tests
  • Added a test verifying the osImageStream status remains empty when a custom OS image is configured, across pool updating, completion, and degraded states.

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.

OCP-88366 now only validates osImageStream is empty when a valid
osImageURL is applied. The degraded pool scenario is moved to a new
test OCP-88814 which uses an invalid osImageURL to trigger degradation
instead of an invalid ignition version, and verifies osImageStream
recovers to rhel-9 after cleanup.
OTP label removed from test 88366, MCO-2025 prefix removed from both
test titles as it belongs in the PR title only.
@HarshwardhanPatil07
Copy link
Copy Markdown
Contributor Author

HarshwardhanPatil07 commented May 8, 2026

/retitle MCO-2025: OCP-88366 and add OCP-88814 for osImageStream with osImageURL

@openshift-ci openshift-ci Bot changed the title Migrate test OCP-88366: osImageStream should be empty when osImageURL is set MCO-2025: OCP-88366 and add OCP-88814 for osImageStream with osImageURL May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 8, 2026

@HarshwardhanPatil07: This pull request references MCO-2025 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 either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead.

Details

In response to this:

Migrated from openshift-tests-private PR #29780. Verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering update-in-progress, post-update, and degraded-pool scenarios.

- What I did

  • Added new test

- How to verify it

- Description for the changelog

  • Migrate test OCP-88366 from openshift-tests-private (PR #29780) to machine-config-operator. The test verifies that status.osImageStream is not reported in the worker MCP when a custom osImageURL is configured, covering three scenarios: during MCP update, after update completion, and when the pool is degraded with an invalid MachineConfig.

Summary by CodeRabbit

  • Tests
  • Added a test verifying the osImageStream status remains empty when a custom OS image is configured, across pool updating, completion, and degraded states.

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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 8, 2026
After deleting the invalid MC, wait for the pool to stop being degraded
before calling waitForComplete, which fails immediately on degraded pools.
…id osImageURL

Invalid osImageURL causes deep node degradation with slow recovery.
Switch to IGNITION_VERSION=99.99.0 which degrades the pool without
attempting an OS pivot, allowing reliable cleanup with DeleteWithWait.
The MCO clears status.osImageStream when the pool is degraded,
regardless of whether osImageURL is set. Updated assertion from
ContainSubstring(rhel-9) to BeEmpty().
@sergiordlr
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: HarshwardhanPatil07, sergiordlr
Once this PR has been reviewed and has the lgtm label, please assign yuqi-zhang 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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 8, 2026

@HarshwardhanPatil07: 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-gcp-op-part1 8f31748 link true /test e2e-gcp-op-part1

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-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants