OCPNODE-4567: Adding e2e test case for runc deprecation#31257
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a Ginkgo E2E test and a Markdown test plan that validate RHCOS 9 nodes use crun as CRI-O's default runtime, confirm machine-config ClusterOperator health, and run a UBI9 workload pinned to a worker node to ensure successful execution. ChangesRunc Deprecation E2E Test
Sequence DiagramsequenceDiagram
participant TestRunner
participant KubeAPI
participant Node
participant MachineConfigCO
participant PodRuntime
TestRunner->>KubeAPI: verify ClusterVersion (Available/Progressing)
TestRunner->>KubeAPI: select worker node
TestRunner->>Node: oc debug -> read /etc/os-release
TestRunner->>KubeAPI: ensure zero ContainerRuntimeConfig
TestRunner->>Node: chroot -> crio status config (check default_runtime="crun")
TestRunner->>MachineConfigCO: get machine-config ClusterOperator status
TestRunner->>KubeAPI: create pod pinned to node
KubeAPI->>Node: schedule pod
Node->>PodRuntime: start container (crun)
PodRuntime->>KubeAPI: update Pod phase -> Succeeded
KubeAPI->>TestRunner: pod status Succeeded
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: asahay19 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (3)
test/extended/node/runcdeprecationcases.md (2)
42-44: 💤 Low valueFenced code block missing language specification.
The fenced code block should specify a language identifier for proper syntax highlighting and markdown linting compliance.
📝 Proposed fix
-``` +```go g.It("Openshift RHCOS 9 cluster install should use crun as the default container runtime")</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.In
@test/extended/node/runcdeprecationcases.mdaround lines 42 - 44, The fenced
code block around the test declaration g.It("Openshift RHCOS 9 cluster install
should use crun as the default container runtime") is missing a language
identifier; update the opening triple-backtick to include a language (e.g., go)
so the block becomes ```go and the snippet containing g.It(...) is properly
highlighted and passes markdown linting.</details> --- `84-94`: _💤 Low value_ **Sample output shows inconsistent OpenShift version.** The sample `/etc/os-release` output shows `OPENSHIFT_VERSION="4.22"`, but this test targets OpenShift 5.0–5.2 clusters (as stated in line 34). Update the sample output to reflect a 5.x version for consistency with the test scope. <details> <summary>📝 Proposed fix</summary> ```diff VARIANT=CoreOS VARIANT_ID=coreos -OPENSHIFT_VERSION="4.22"</pre> +OPENSHIFT_VERSION="5.0"</pre> ``` </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/extended/node/runcdeprecationcases.md` around lines 84 - 94, The sample /etc/os-release output shows OPENSHIFT_VERSION="4.22" which conflicts with the test scope (OpenShift 5.0–5.2); update the sample output by changing the OPENSHIFT_VERSION entry to a 5.x value within that range (e.g., OPENSHIFT_VERSION="5.1") so the example matches the test target; ensure only the OPENSHIFT_VERSION string in the shown block is modified. ``` </details> </blockquote></details> <details> <summary>test/extended/node/runcdeprecationcases.go (1)</summary><blockquote> `40-42`: _⚡ Quick win_ **Add an explicit version-scope gate (or relax the test description).** The test description claims OpenShift 5.0–5.2 targeting, but current logic does not enforce that range. This can cause scope drift in future lanes. Also applies to: 44-60 <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/extended/node/runcdeprecationcases.go` around lines 40 - 42, The test G.It invocation labeled "Openshift RHCOS 9 cluster install should use crun as the default container runtime" claims OpenShift 5.0–5.2 scope but does not enforce it; update the test to either add an explicit version gate (e.g., check cluster/OpenShift version inside the test or use an existing version gating helper) that restricts execution to 5.0–5.2, or change the test description to remove the version range so it accurately reflects current behavior; apply the same change to the nearby test block(s) referenced around the same G.It (lines 44–60) so the description and logic remain consistent. ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>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/runcdeprecationcases.go:
- Around line 126-127: The test references an external image
("registry.access.redhat.com/ubi9/ubi-minimal") in the container spec (Image
field) which creates a dependency on external registries; update the Image value
in the test workload (runcdeprecationcases.go) to use a local/harness-provided
image constant or an internal registry image (e.g., replace the literal with the
test framework's image constant or a preloaded image name) so the test does not
require public registry access; make the same change for the other occurrence
around the Command/ Image tuple noted (lines ~136-137).- Around line 90-93: The test currently logs the full CRI-O config via
framework.Logf and includes crioConfig in the o.Expect failure message
(references: framework.Logf, o.Expect, crioConfig, targetNode); remove or redact
any direct printing of crioConfig and only log non-sensitive info (e.g., node
name and a short confirmation). Update the framework.Logf call to not include
crioConfig (log "Confirmed: CRI-O default_runtime is crun on node %s") and
change the o.Expect failure message to omit crioConfig (or replace it with a
redacted summary), ensuring no internal hostnames or config contents are written
to test output.- Around line 116-131: The test creates a Pod object named "pod" to validate
CRI-O on targetNode but does not pin the Pod to that node, allowing it to
schedule elsewhere; set the PodSpec's NodeName (e.g., pod.Spec.NodeName =
targetNode.Name or pod.Spec.NodeName = targetNode) before creating the Pod so
the validation container actually runs on the inspected node (update the Pod
defined in runcdeprecationcases.go where the variable pod and targetNode are
used).In
@test/extended/node/runcdeprecationcases.md:
- Line 43: The test name in the markdown doesn't exactly match the test string
used in the code; update the markdown entry so the text exactly matches the g.It
test string used in runcdeprecationcases.go (the g.It("Openshift␣␣RHCOS 9
cluster install should use crun as the default container runtime␣") literal) —
include the two spaces between "Openshift" and "RHCOS" and the trailing space to
ensure exact string parity for traceability.
Nitpick comments:
In@test/extended/node/runcdeprecationcases.go:
- Around line 40-42: The test G.It invocation labeled "Openshift RHCOS 9
cluster install should use crun as the default container runtime" claims
OpenShift 5.0–5.2 scope but does not enforce it; update the test to either add
an explicit version gate (e.g., check cluster/OpenShift version inside the test
or use an existing version gating helper) that restricts execution to 5.0–5.2,
or change the test description to remove the version range so it accurately
reflects current behavior; apply the same change to the nearby test block(s)
referenced around the same G.It (lines 44–60) so the description and logic
remain consistent.In
@test/extended/node/runcdeprecationcases.md:
- Around line 42-44: The fenced code block around the test declaration
g.It("Openshift RHCOS 9 cluster install should use crun as the default container
runtime") is missing a language identifier; update the opening triple-backtick
to include a language (e.g., go) so the block becomes ```go and the snippet
containing g.It(...) is properly highlighted and passes markdown linting.- Around line 84-94: The sample /etc/os-release output shows
OPENSHIFT_VERSION="4.22" which conflicts with the test scope (OpenShift
5.0–5.2); update the sample output by changing the OPENSHIFT_VERSION entry to a
5.x value within that range (e.g., OPENSHIFT_VERSION="5.1") so the example
matches the test target; ensure only the OPENSHIFT_VERSION string in the shown
block is modified.</details> <details> <summary>🪄 Autofix (Beta)</summary> Fix all unresolved CodeRabbit comments on this PR: - [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended) - [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository YAML (base), Central YAML (inherited) **Review profile**: CHILL **Plan**: Enterprise **Run ID**: `e31f326c-312f-4c15-af73-0429258526bc` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between d94e68755167f4049c6f1388eb426e807522c264 and 169675c2817dfffe41d13982a67548766b8331c4. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `test/extended/node/runcdeprecationcases.go` * `test/extended/node/runcdeprecationcases.md` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
@asahay19: This pull request references OCPNODE-4567 which is a valid jira issue. 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. |
|
/retest |
|
Scheduling required tests: |
|
Risk analysis has seen new tests most likely introduced by this PR. New Test Risks for sha: d859a3c
New tests seen in this PR at sha: d859a3c
|
|
Scheduling required tests: |
|
@asahay19: all tests passed! 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. |
|
Risk analysis has seen new tests most likely introduced by this PR. New tests seen in this PR at sha: f1280dc
|
This PR is regarding adding e2e test case for runc deprecation cases. This PR covers implementation on Openshift 5.0-5.2 cluster on RHCOS 9 must use
crunas the default container runtime , with nocustom
ContainerRuntimeConfigin place. Workloads are getting created successfully. I have added Test Plan with all the meta data and Manual steps in md fileJira: https://issues.redhat.com/browse/OCPNODE-4567
Epic: https://issues.redhat.com/browse/OCPNODE-4013
Strat: https://issues.redhat.com/browse/OCPSTRAT-3154
I executed it loclly and it got passed:
Output:
./openshift-tests run-test "[Jira:Node][sig-node] runc deprecation cases Openshift RHCOS 9 cluster install should use crun as the default container runtime [Suite:openshift/conformance/parallel]"Ran 1 of 1 Specs in 30.591 seconds SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped [ { "name": "[Jira:Node][sig-node] runc deprecation cases Openshift RHCOS 9 cluster install should use crun as the default container runtime [Suite:openshift/conformance/parallel]", "lifecycle": "blocking", "duration": 30591, "startTime": "2026-06-04 08:56:16.904133 UTC", "endTime": "2026-06-04 08:56:47.495635 UTC", "result": "passed",Summary by CodeRabbit
Tests
Documentation