Skip to content

OCPNODE-4179: Migrating test case OCP-80983 from openshift-tests-private to origin#30899

Open
Chandan9112 wants to merge 1 commit intoopenshift:mainfrom
Chandan9112:migrate-ocp-80983
Open

OCPNODE-4179: Migrating test case OCP-80983 from openshift-tests-private to origin#30899
Chandan9112 wants to merge 1 commit intoopenshift:mainfrom
Chandan9112:migrate-ocp-80983

Conversation

@Chandan9112
Copy link
Copy Markdown

@Chandan9112 Chandan9112 commented Mar 18, 2026

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

Note for Reviewer:

Moved MicroShift skip check from individual test cases to g.BeforeEach block,
following the same pattern used in node_swap.go and image_volume.go.
This avoids duplicating the check inside every test case.

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]"

 Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
  ===================================================================
  Random Seed: 1774590063 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default
  github.com/openshift/origin/test/extended/node/node_e2e/node.go:81
    STEP: Creating a kubernetes client @ 03/27/26 11:11:07.766
  I0327 11:11:07.767101   36500 discovery.go:214] Invalidating discovery information
  I0327 11:11:07.767608 36500 framework.go:2330] [precondition-check] checking if cluster is MicroShift
  I0327 11:11:08.074681 36500 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
    STEP: 1) Get a Ready worker node and check cgroup version @ 03/27/26 11:11:08.074
  I0327 11:11:12.389870 36500 node.go:90] cgroup version info is: [cgroup2fs]

    STEP: 2) Changing cgroup from v2 to v1 should result in error @ 03/27/26 11:11:12.389
  I0327 11:11:14.120710 36500 client.go:1094] Error running oc --kubeconfig=/Users/cmaurya/Downloads/cluster-bot-2026-03-27-043007.kubeconfig patch nodes.config.openshift.io cluster -p {"spec": {"cgroupMode": "v1"}} --type=merge:
  StdOut>
  The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
  StdErr>
  The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""

  • [6.366 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 6.367 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

@openshift-ci-robot
Copy link
Copy Markdown

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 Mar 18, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 18, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 18, 2026

@Chandan9112: This pull request references OCPNODE-4179 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • All nodes are in Ready state
  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • Kernel arguments include cgroupv2 parameters
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager should verify cgroupv2 is the default and cgroupv1 cannot be set [OCP-80983] [apigroup:config.openshift.io] [apigroup:machineconfiguration.openshift.io] [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
===================================================================
 Random Seed: 1773824700 - will randomize all specs
 Will run 1 of 1 specs

[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager should verify cgroupv2 is the default and cgroupv1 cannot be set [OCP-80983] [apigroup:config.openshift.io] [apigroup:machineconfiguration.openshift.io]
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:83
   STEP: Creating a kubernetes client @ 03/18/26 14:35:04.858
 I0318 14:35:04.859488   74544 discovery.go:214] Invalidating discovery information
 I0318 14:35:04.860832 74544 framework.go:2324] [precondition-check] checking if cluster is MicroShift
 I0318 14:35:05.119305 74544 framework.go:2348] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: Step 1: Checking all nodes are Ready @ 03/18/26 14:35:05.119
 I0318 14:35:10.785102 74544 node.go:105] All 6 nodes are Ready
   STEP: Step 2: Verifying cgroup version is v2 on a worker node @ 03/18/26 14:35:10.785
 I0318 14:35:13.700010 74544 node.go:118] Cgroup filesystem type on node ci-ln-1qq51kt-72292-6qbtc-worker-b-df8pw: Starting pod/ci-ln-1qq51kt-72292-6qbtc-worker-b-df8pw-debug-hrdcj ...
 To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
 cgroup2fs

 Removing debug pod ...
   STEP: Step 3: Checking kernel arguments for cgroupv2 in rendered worker MachineConfig @ 03/18/26 14:35:13.7
 I0318 14:35:14.343939 74544 node.go:127] Rendered worker MachineConfig: rendered-worker-c7db908c3514316cff8986951195a3a2
 I0318 14:35:15.185923 74544 node.go:132] Kernel arguments: systemd.unified_cgroup_hierarchy=1 cgroup_no_v1="all"
   STEP: Step 4: Verifying that setting cgroupMode to v1 is rejected by the API server @ 03/18/26 14:35:15.186
 I0318 14:35:15.715687   74544 warnings.go:110] "Warning: unknown field \"spec.minimumKubeletVersion\""
 I0318 14:35:15.716170 74544 node.go:145] cgroupMode v1 correctly rejected with error: Node.config.openshift.io "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 • [10.881 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 10.881 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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

openshift-ci bot commented Mar 18, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Moved MicroShift detection to a Describe-level BeforeEach that skips the entire Describe on MicroShift; removed per-test MicroShift checks. Added an It test that verifies /sys/fs/cgroup is cgroupv2 and that patching nodes.config.openshift.io/cluster.spec.cgroupMode to v1 is rejected.

Changes

Cohort / File(s) Summary
Test setup and cgroup validation
test/extended/node/node_e2e/node.go
Added a Describe-level g.BeforeEach calling exutil.IsMicroShiftCluster(...) to skip the Describe on MicroShift; removed inline MicroShift handling from the KUBELET_LOG_LEVEL test. Added [OTP] validate cgroupv2 is default It: checks /sys/fs/cgroup reports cgroup2fs and asserts a patch setting spec.cgroupMode: v1 on nodes.config.openshift.io/cluster fails with an "Unsupported value" message.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

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

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.4)

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


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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

})

//author: cmaurya@redhat.com
g.It("should verify cgroupv2 is the default and cgroupv1 cannot be set [OCP-80983] [apigroup:config.openshift.io] [apigroup:machineconfiguration.openshift.io]", 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.

Add the “[OTP]” annotation in the test name to tests that are ported from openshift-test-private. And also I think no need to add Polarian test case name.
Can remove [OCP-80983] [apigroup:config.openshift.io] [apigroup:machineconfiguration.openshift.io] .

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed in the latest comit

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 19, 2026

@Chandan9112: This pull request references OCPNODE-4179 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • All nodes are in Ready state
  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • Kernel arguments include cgroupv2 parameters
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager should verify cgroupv2 is the default and cgroupv1 cannot be set [OCP-80983] [apigroup:config.openshift.io] [apigroup:machineconfiguration.openshift.io] [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
===================================================================
 Random Seed: 1773824700 - will randomize all specs
 Will run 1 of 1 specs

[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] should verify cgroupv2 is the default and cgroupv1 cannot be set
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:83
   STEP: Creating a kubernetes client @ 03/19/26 13:48:59.651
 I0319 13:48:59.652863   48747 discovery.go:214] Invalidating discovery information
 I0319 13:48:59.654028 48747 framework.go:2324] [precondition-check] checking if cluster is MicroShift
 I0319 13:48:59.908333 48747 framework.go:2348] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: 1) Checking all nodes are Ready @ 03/19/26 13:48:59.908
 I0319 13:49:04.792688 48747 node.go:105] All 6 nodes are Ready
   STEP: 2) Verifying cgroup version is v2 on a worker node @ 03/19/26 13:49:04.792
 I0319 13:49:16.759908 48747 node.go:118] Cgroup filesystem type on node ci-ln-qg4f142-72292-hsbcd-worker-a-79n8q: Starting pod/ci-ln-qg4f142-72292-hsbcd-worker-a-79n8q-debug-8pqwh ...
 To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
 cgroup2fs

 Removing debug pod ...
   STEP: 3) Checking kernel arguments for cgroupv2 in rendered worker MachineConfig @ 03/19/26 13:49:16.76
 I0319 13:49:17.397260 48747 node.go:127] Rendered worker MachineConfig: rendered-worker-3eb6a567caccbdd0b82963e7c0011c54
 I0319 13:49:18.365552 48747 node.go:132] Kernel arguments: systemd.unified_cgroup_hierarchy=1 cgroup_no_v1="all"
   STEP: 4) Verifying that setting cgroupMode to v1 is rejected by the API server @ 03/19/26 13:49:18.365
 I0319 13:49:18.889681   48747 warnings.go:110] "Warning: unknown field \"spec.minimumKubeletVersion\""
 I0319 13:49:18.890194 48747 node.go:145] cgroupMode v1 correctly rejected with error: Node.config.openshift.io "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 • [19.257 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 19.258 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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

openshift-ci-robot commented Mar 19, 2026

@Chandan9112: This pull request references OCPNODE-4179 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 "4.22.0" version, but no target version was set.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • All nodes are in Ready state
  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • Kernel arguments include cgroupv2 parameters
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] should verify cgroupv2 is the default and cgroupv1 cannot be set [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
===================================================================
 Random Seed: 1773824700 - will randomize all specs
 Will run 1 of 1 specs

[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] should verify cgroupv2 is the default and cgroupv1 cannot be set
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:83
   STEP: Creating a kubernetes client @ 03/19/26 13:48:59.651
 I0319 13:48:59.652863   48747 discovery.go:214] Invalidating discovery information
 I0319 13:48:59.654028 48747 framework.go:2324] [precondition-check] checking if cluster is MicroShift
 I0319 13:48:59.908333 48747 framework.go:2348] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: 1) Checking all nodes are Ready @ 03/19/26 13:48:59.908
 I0319 13:49:04.792688 48747 node.go:105] All 6 nodes are Ready
   STEP: 2) Verifying cgroup version is v2 on a worker node @ 03/19/26 13:49:04.792
 I0319 13:49:16.759908 48747 node.go:118] Cgroup filesystem type on node ci-ln-qg4f142-72292-hsbcd-worker-a-79n8q: Starting pod/ci-ln-qg4f142-72292-hsbcd-worker-a-79n8q-debug-8pqwh ...
 To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
 cgroup2fs

 Removing debug pod ...
   STEP: 3) Checking kernel arguments for cgroupv2 in rendered worker MachineConfig @ 03/19/26 13:49:16.76
 I0319 13:49:17.397260 48747 node.go:127] Rendered worker MachineConfig: rendered-worker-3eb6a567caccbdd0b82963e7c0011c54
 I0319 13:49:18.365552 48747 node.go:132] Kernel arguments: systemd.unified_cgroup_hierarchy=1 cgroup_no_v1="all"
   STEP: 4) Verifying that setting cgroupMode to v1 is rejected by the API server @ 03/19/26 13:49:18.365
 I0319 13:49:18.889681   48747 warnings.go:110] "Warning: unknown field \"spec.minimumKubeletVersion\""
 I0319 13:49:18.890194 48747 node.go:145] cgroupMode v1 correctly rejected with error: Node.config.openshift.io "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 • [19.257 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 19.258 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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.

nodeConfig.Spec.CgroupMode = configv1.CgroupMode("v1")
_, updateErr := oc.AdminConfigClient().ConfigV1().Nodes().Update(ctx, nodeConfig, metav1.UpdateOptions{})
o.Expect(updateErr).To(o.HaveOccurred(), "expected API server to reject cgroupMode v1, but update succeeded")
e2e.Logf("cgroupMode v1 correctly rejected with error: %v", updateErr)
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.

When changing cgroup from v2 to v1, in message it should show like this: error: nodes.config.openshift.io "cluster" is invalid .

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.

please update the error log message

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed in the latest comit. The error message will look like this.
The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 19, 2026

@Chandan9112: This pull request references OCPNODE-4179 which is a valid jira issue.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • All nodes are in Ready state
  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • Kernel arguments include cgroupv2 parameters
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] should verify cgroupv2 is the default and cgroupv1 cannot be set [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
===================================================================
 Random Seed: 1773824700 - will randomize all specs
 Will run 1 of 1 specs

[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:80
   STEP: Creating a kubernetes client @ 03/19/26 17:36:05.278
 I0319 17:36:05.280196   60668 discovery.go:214] Invalidating discovery information
 I0319 17:36:05.281259 60668 framework.go:2324] [precondition-check] checking if cluster is MicroShift
 I0319 17:36:05.519997 60668 framework.go:2348] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: 1) Check cgroup version @ 03/19/26 17:36:05.52
 I0319 17:36:09.345400 60668 utils.go:17] cgroup version info is: [Starting pod/ci-ln-j9j0nyt-72292-ztn64-worker-a-t9wrd-debug-cxr7d ...
 To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
 cgroup2fs

 Removing debug pod ...

   STEP: 2) Changing cgroup from v2 to v1 should result in error @ 03/19/26 17:36:09.345
 I0319 17:36:10.712419 60668 client.go:1094] Error running oc --kubeconfig=/Users/cmaurya/Downloads/cluster-bot-2026-03-19-110013.kubeconfig patch nodes.config.openshift.io cluster -p {"spec": {"cgroupMode": "v1"}} --type=merge:
 StdOut>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 StdErr>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""

 • [5.453 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 5.454 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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

openshift-ci-robot commented Mar 23, 2026

@Chandan9112: This pull request references OCPNODE-4179 which is a valid jira issue.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

Note for Reviewer:

Moved MicroShift skip check from individual test cases to g.BeforeEach block,
following the same pattern used in node_swap.go and image_volume.go.
This avoids duplicating the check inside every test case.

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
 ===================================================================
 Random Seed: 1774258024 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:80
   STEP: Creating a kubernetes client @ 03/23/26 14:57:07.71
 I0323 14:57:07.711243   77055 discovery.go:214] Invalidating discovery information
 I0323 14:57:07.712443 77055 framework.go:2324] [precondition-check] checking if cluster is MicroShift
 I0323 14:57:07.955519 77055 framework.go:2348] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: 1) Check cgroup version @ 03/23/26 14:57:07.955
 I0323 14:57:20.047498 77055 node.go:86] cgroup version info is: [Starting pod/ci-ln-5jd8dwt-72292-b9f7z-worker-b-th2vp-debug-4lzp8 ...
 To use host binaries, run `chroot /host`. Instead, if you need to access host namespaces, run `nsenter -a -t 1`.
 cgroup2fs

 Removing debug pod ...]

   STEP: 2) Changing cgroup from v2 to v1 should result in error @ 03/23/26 14:57:20.047
 I0323 14:57:21.467566 77055 client.go:1094] Error running oc --kubeconfig=/Users/cmaurya/Downloads/cluster-bot-2026-03-23-082435.kubeconfig patch nodes.config.openshift.io cluster -p {"spec": {"cgroupMode": "v1"}} --type=merge:
 StdOut>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 StdErr>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""

 • [13.779 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 13.779 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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.

@Chandan9112 Chandan9112 marked this pull request as ready for review March 26, 2026 04:42
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 26, 2026
@openshift-ci openshift-ci bot requested review from lyman9966 and sairameshv March 26, 2026 04:43
@openshift-ci-robot
Copy link
Copy Markdown

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


g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"

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.

remove this extra line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed in the latest commit

@openshift-trt
Copy link
Copy Markdown

openshift-trt bot commented Mar 26, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New tests seen in this PR at sha: 332f7a4

  • "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]

g.By("2) Changing cgroup from v2 to v1 should result in error")
output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(strings.Contains(output, "Unsupported value: \"v1\"")).Should(o.BeTrue())
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.

same as above

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

🧹 Nitpick comments (1)
test/extended/node/node_e2e/node.go (1)

19-26: Cache the MicroShift probe result instead of re-running it before every test

exutil.IsMicroShiftCluster can poll for minutes; putting it in BeforeEach repeats that cost for every It and increases timeout/flakiness risk as this block grows. Compute once per Describe and reuse the result in BeforeEach.

Suggested refactor
+import "sync"
+
 var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager", func() {
 	var (
 		oc = exutil.NewCLIWithoutNamespace("node").AsAdmin()
+		microShiftOnce sync.Once
+		isMicroShift bool
+		microShiftErr error
 	)

 	// Skip all tests on MicroShift clusters as MachineConfig resources are not available
 	g.BeforeEach(func() {
-		isMicroShift, err := exutil.IsMicroShiftCluster(oc.AdminKubeClient())
-		o.Expect(err).NotTo(o.HaveOccurred())
+		microShiftOnce.Do(func() {
+			isMicroShift, microShiftErr = exutil.IsMicroShiftCluster(oc.AdminKubeClient())
+		})
+		o.Expect(microShiftErr).NotTo(o.HaveOccurred())
 		if isMicroShift {
 			g.Skip("Skipping test on MicroShift cluster")
 		}
 	})

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_e2e/node.go` around lines 19 - 26, Compute the
MicroShift probe once and reuse it: declare a Describe-scoped (or
package-scoped) variable like cachedIsMicroShift bool, run the expensive probe a
single time (e.g., in g.BeforeSuite or at the outer Describe setup) by calling
exutil.IsMicroShiftCluster(oc.AdminKubeClient()) and storing the result (and
assert err with o.Expect(err).NotTo(o.HaveOccurred())), then change the existing
g.BeforeEach block to check cachedIsMicroShift and call g.Skip("Skipping test on
MicroShift cluster") when true instead of re-invoking
exutil.IsMicroShiftCluster; keep existing references to o.Expect and g.Skip but
remove the repeated probe call.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 90-92: The assertion is too brittle by matching the full error
sentence; relax it to assert the command failed
(o.Expect(err).Should(o.HaveOccurred())) and that the output contains stable
fragments such as "spec.cgroupMode", "Unsupported value" and the rejected value
"\"v1\"" (or "v1") instead of the entire message. Locate the patch invocation
(oc.AsAdmin().WithoutNamespace().Run("patch")... ) and replace the single
o.ContainSubstring check with multiple contains assertions for those fragments
(or a single contains that concatenates stable fragments) to make the test
resilient to wording/casing changes.

---

Nitpick comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 19-26: Compute the MicroShift probe once and reuse it: declare a
Describe-scoped (or package-scoped) variable like cachedIsMicroShift bool, run
the expensive probe a single time (e.g., in g.BeforeSuite or at the outer
Describe setup) by calling exutil.IsMicroShiftCluster(oc.AdminKubeClient()) and
storing the result (and assert err with o.Expect(err).NotTo(o.HaveOccurred())),
then change the existing g.BeforeEach block to check cachedIsMicroShift and call
g.Skip("Skipping test on MicroShift cluster") when true instead of re-invoking
exutil.IsMicroShiftCluster; keep existing references to o.Expect and g.Skip but
remove the repeated probe call.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8a542e0c-a347-48eb-b629-3c7e9932b606

📥 Commits

Reviewing files that changed from the base of the PR and between c7c5091 and c2c8ffd.

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

Comment on lines +90 to +92
output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(output).To(o.ContainSubstring("The Node \"cluster\" is invalid: spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\""))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Line 92 is too strict and can make the test flaky across message-format changes

The test intent is to verify rejection of spec.cgroupMode: "v1", but matching the full sentence ties the test to exact wording/casing. Assert stable fragments instead.

More resilient assertion
 output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
 o.Expect(err).Should(o.HaveOccurred())
-o.Expect(output).To(o.ContainSubstring("The Node \"cluster\" is invalid: spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\""))
+o.Expect(output).To(o.ContainSubstring("spec.cgroupMode: Unsupported value: \"v1\""))
+o.Expect(output).To(o.ContainSubstring("supported values: \"v2\", \"\""))

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

📝 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
output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(output).To(o.ContainSubstring("The Node \"cluster\" is invalid: spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\""))
output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(output).To(o.ContainSubstring("spec.cgroupMode: Unsupported value: \"v1\""))
o.Expect(output).To(o.ContainSubstring("supported values: \"v2\", \"\""))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_e2e/node.go` around lines 90 - 92, The assertion is
too brittle by matching the full error sentence; relax it to assert the command
failed (o.Expect(err).Should(o.HaveOccurred())) and that the output contains
stable fragments such as "spec.cgroupMode", "Unsupported value" and the rejected
value "\"v1\"" (or "v1") instead of the entire message. Locate the patch
invocation (oc.AsAdmin().WithoutNamespace().Run("patch")... ) and replace the
single o.ContainSubstring check with multiple contains assertions for those
fragments (or a single contains that concatenates stable fragments) to make the
test resilient to wording/casing changes.

@openshift-ci-robot
Copy link
Copy Markdown

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-trt
Copy link
Copy Markdown

openshift-trt bot commented Mar 26, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New tests seen in this PR at sha: c2c8ffd

  • "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" [Total: 4, Pass: 4, Fail: 0, Flake: 0]

@openshift-ci-robot
Copy link
Copy Markdown

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-trt
Copy link
Copy Markdown

openshift-trt bot commented Mar 27, 2026

Job Failure Risk Analysis for sha: 5a3753d

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 IncompleteTests
Tests for this run (57) are below the historical average (2761): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New tests seen in this PR at sha: 5a3753d

  • "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]

g.By("1) Check cgroup version")
workerNode, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
o.Expect(err).NotTo(o.HaveOccurred())
cgroupV, err := oc.AsAdmin().WithoutNamespace().Run("debug").Args("node/"+workerNode, "-n", "default", "--", "chroot", "/host", "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup").Output()
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.

Use nodeutils.ExecOnNodeWithChroot

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

updated in latest comit

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

♻️ Duplicate comments (1)
test/extended/node/node_e2e/node.go (1)

91-93: ⚠️ Potential issue | 🟠 Major

Use stable fragments for the rejection check.

Line 93 still matches one exact validation sentence. That's brittle across API message wording changes; assert on stable fragments instead.

More resilient assertion
 		output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
 		o.Expect(err).Should(o.HaveOccurred())
-		o.Expect(output).To(o.ContainSubstring("spec.cgroupMode: Unsupported value: \"v1\": supported values: \"v2\", \"\""))
+		o.Expect(output).To(o.ContainSubstring("spec.cgroupMode"))
+		o.Expect(output).To(o.ContainSubstring("Unsupported value"))
+		o.Expect(output).To(o.ContainSubstring(`"v1"`))
+		o.Expect(output).To(o.ContainSubstring(`"v2"`))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_e2e/node.go` around lines 91 - 93, The test currently
asserts the exact validation sentence from the patch output (in the
oc.AsAdmin().WithoutNamespace().Run("patch") call) which is brittle; change the
assertion to check for stable fragments instead—ensure
o.Expect(err).Should(o.HaveOccurred()) is kept and replace the single exact
message check on output with assertions that it contains stable substrings such
as "Unsupported value", "cgroupMode", and "v1" (or alternatively "supported
values") so the failure is still detected without relying on exact wording.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 82-90: The test currently queries only the first worker node
(jsonpath {.items[0]}) and calls nodeutils.ExecOnNodeWithChroot without ensuring
the node is Ready, which can skip kernel-arg assertions; change the node query
to return all worker names (e.g. jsonpath {.items[*].metadata.name}), split and
iterate each worker name (replace the single-use workerNode variable with a
loop), for each node verify Ready status (use an existing wait/ready helper or
query .status.conditions for type=Ready before proceeding) then call
nodeutils.ExecOnNodeWithChroot for that node and perform the kernel-arg and
cgroup assertions per-node so non-Ready or misconfigured workers are exercised.
Ensure you update references to workerNode and the
oc.AsAdmin().WithoutNamespace().Run(...).Args(...) call and keep
nodeutils.ExecOnNodeWithChroot usage inside the per-node loop.

---

Duplicate comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 91-93: The test currently asserts the exact validation sentence
from the patch output (in the oc.AsAdmin().WithoutNamespace().Run("patch") call)
which is brittle; change the assertion to check for stable fragments
instead—ensure o.Expect(err).Should(o.HaveOccurred()) is kept and replace the
single exact message check on output with assertions that it contains stable
substrings such as "Unsupported value", "cgroupMode", and "v1" (or alternatively
"supported values") so the failure is still detected without relying on exact
wording.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c39959f8-ab44-45ea-ad90-324778e36c3e

📥 Commits

Reviewing files that changed from the base of the PR and between 5a3753d and 150a58c.

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

Comment on lines +82 to +90
g.By("1) Check cgroup version")
workerNode, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
o.Expect(err).NotTo(o.HaveOccurred())
cgroupV, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup")
o.Expect(err).NotTo(o.HaveOccurred())
e2e.Logf("cgroup version info is: [%v]\n", cgroupV)
o.Expect(cgroupV).To(o.ContainSubstring("cgroup2fs"))

g.By("2) Changing cgroup from v2 to v1 should result in error")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This It still misses part of the migrated coverage.

Line 83 hard-codes .items[0], so only one worker is probed, and the helper used at Line 85 does not verify that node is Ready first. That leaves the kernel-arg assertion out entirely and can miss non-Ready or misconfigured workers.

Possible shape of the fix
-		workerNode, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
+		workerNodes, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={range .items[*]}{.metadata.name}{'\n'}{end}").Output()
 		o.Expect(err).NotTo(o.HaveOccurred())
-		cgroupV, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup")
-		o.Expect(err).NotTo(o.HaveOccurred())
-		e2e.Logf("cgroup version info is: [%v]\n", cgroupV)
-		o.Expect(cgroupV).To(o.ContainSubstring("cgroup2fs"))
+		workers := strings.Fields(workerNodes)
+		o.Expect(workers).NotTo(o.BeEmpty(), "expected at least one worker node")
+		for _, workerNode := range workers {
+			ready, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("node", workerNode, "-o=jsonpath={.status.conditions[?(@.type=='Ready')].status}").Output()
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(strings.TrimSpace(ready)).To(o.Equal("True"))
+
+			cgroupV, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup")
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(cgroupV).To(o.ContainSubstring("cgroup2fs"))
+
+			cmdline, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "cat /proc/cmdline")
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(cmdline).To(o.ContainSubstring("systemd.unified_cgroup_hierarchy=1"))
+			o.Expect(cmdline).To(o.ContainSubstring("cgroup_no_v1"))
+		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_e2e/node.go` around lines 82 - 90, The test currently
queries only the first worker node (jsonpath {.items[0]}) and calls
nodeutils.ExecOnNodeWithChroot without ensuring the node is Ready, which can
skip kernel-arg assertions; change the node query to return all worker names
(e.g. jsonpath {.items[*].metadata.name}), split and iterate each worker name
(replace the single-use workerNode variable with a loop), for each node verify
Ready status (use an existing wait/ready helper or query .status.conditions for
type=Ready before proceeding) then call nodeutils.ExecOnNodeWithChroot for that
node and perform the kernel-arg and cgroup assertions per-node so non-Ready or
misconfigured workers are exercised. Ensure you update references to workerNode
and the oc.AsAdmin().WithoutNamespace().Run(...).Args(...) call and keep
nodeutils.ExecOnNodeWithChroot usage inside the per-node loop.

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 27, 2026

@Chandan9112: This pull request references OCPNODE-4179 which is a valid jira issue.

Details

In response to this:

Adds automated test case OCP-80983 migrated from openshift-tests-private. The test validates:

  • Cgroup version is v2 (cgroup2fs) on worker nodes
  • API server rejects setting cgroupMode to v1

Here is the test case link: Polarian-80983

Note for Reviewer:

Moved MicroShift skip check from individual test cases to g.BeforeEach block,
following the same pattern used in node_swap.go and image_volume.go.
This avoids duplicating the check inside every test case.

It passed successfully while executing on a live OCP 4.21 cluster:

./openshift-tests run-test "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]"

Running Suite:  - /Users/cmaurya/go/src/github.com/openshift/origin
 ===================================================================
 Random Seed: 1774590063 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:81
   STEP: Creating a kubernetes client @ 03/27/26 11:11:07.766
 I0327 11:11:07.767101   36500 discovery.go:214] Invalidating discovery information
 I0327 11:11:07.767608 36500 framework.go:2330] [precondition-check] checking if cluster is MicroShift
 I0327 11:11:08.074681 36500 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: 1) Get a Ready worker node and check cgroup version @ 03/27/26 11:11:08.074
 I0327 11:11:12.389870 36500 node.go:90] cgroup version info is: [cgroup2fs]

   STEP: 2) Changing cgroup from v2 to v1 should result in error @ 03/27/26 11:11:12.389
 I0327 11:11:14.120710 36500 client.go:1094] Error running oc --kubeconfig=/Users/cmaurya/Downloads/cluster-bot-2026-03-27-043007.kubeconfig patch nodes.config.openshift.io cluster -p {"spec": {"cgroupMode": "v1"}} --type=merge:
 StdOut>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""
 StdErr>
 The Node "cluster" is invalid: spec.cgroupMode: Unsupported value: "v1": supported values: "v2", ""

 • [6.366 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 6.367 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped

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.

♻️ Duplicate comments (1)
test/extended/node/node_e2e/node.go (1)

82-91: ⚠️ Potential issue | 🟠 Major

This still only validates one worker and skips the boot-arg part of the port.

Using .items[0] lets the test pass with a misconfigured or NotReady second worker, and there is no assertion for the expected cgroupv2 kernel args at all. That leaves the migrated OCP-80983 coverage incomplete.

Possible shape of the fix
-		workerNode, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
+		workerNodes, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={range .items[*]}{.metadata.name}{'\n'}{end}").Output()
 		o.Expect(err).NotTo(o.HaveOccurred())
-		nodeStatus, err := oc.AsAdmin().Run("get").Args("nodes", workerNode, "-o=jsonpath={.status.conditions[?(@.type=='Ready')].status}").Output()
-		o.Expect(err).NotTo(o.HaveOccurred())
-		o.Expect(nodeStatus).To(o.Equal("True"), "Worker node %s is not Ready", workerNode)
-		cgroupV, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup")
-		o.Expect(err).NotTo(o.HaveOccurred())
-		e2e.Logf("cgroup version info is: [%v]\n", cgroupV)
-		o.Expect(cgroupV).To(o.ContainSubstring("cgroup2fs"))
+		workers := strings.Fields(workerNodes)
+		o.Expect(workers).NotTo(o.BeEmpty(), "expected at least one worker node")
+		for _, workerNode := range workers {
+			nodeStatus, err := oc.AsAdmin().Run("get").Args("nodes", workerNode, "-o=jsonpath={.status.conditions[?(@.type=='Ready')].status}").Output()
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(nodeStatus).To(o.Equal("True"), "Worker node %s is not Ready", workerNode)
+
+			cgroupV, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup")
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(cgroupV).To(o.ContainSubstring("cgroup2fs"))
+
+			cmdline, err := nodeutils.ExecOnNodeWithChroot(oc, workerNode, "/bin/bash", "-c", "cat /proc/cmdline")
+			o.Expect(err).NotTo(o.HaveOccurred())
+			o.Expect(cmdline).To(o.ContainSubstring("systemd.unified_cgroup_hierarchy=1"))
+			o.Expect(cmdline).To(o.ContainSubstring("cgroup_no_v1"))
+		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/node/node_e2e/node.go` around lines 82 - 91, The test currently
only checks a single worker (using .items[0]) and only validates the filesystem
type; update the logic in node.go to list all worker nodes (by label selector),
iterate over each worker node name, assert each node is Ready (reuse the
nodeStatus check), run nodeutils.ExecOnNodeWithChroot for each node to verify
cgroup v2 (reuse cgroupV) and additionally exec into each node to read
/proc/cmdline (or use a similar command) and assert the kernel boot args contain
the expected cgroup v2 flags (add assertions for required args such as the
unified cgroup flag used by your platform), failing the test if any worker is
NotReady or missing cgroup v2 or the required kernel args. Ensure you reference
and update the existing variables/functions: the label query that produced
workerNode, the nodeStatus check, nodeutils.ExecOnNodeWithChroot, and the
cgroupV assertions so they run per-node instead of only on .items[0].
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 82-91: The test currently only checks a single worker (using
.items[0]) and only validates the filesystem type; update the logic in node.go
to list all worker nodes (by label selector), iterate over each worker node
name, assert each node is Ready (reuse the nodeStatus check), run
nodeutils.ExecOnNodeWithChroot for each node to verify cgroup v2 (reuse cgroupV)
and additionally exec into each node to read /proc/cmdline (or use a similar
command) and assert the kernel boot args contain the expected cgroup v2 flags
(add assertions for required args such as the unified cgroup flag used by your
platform), failing the test if any worker is NotReady or missing cgroup v2 or
the required kernel args. Ensure you reference and update the existing
variables/functions: the label query that produced workerNode, the nodeStatus
check, nodeutils.ExecOnNodeWithChroot, and the cgroupV assertions so they run
per-node instead of only on .items[0].

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27808931-f02a-4347-aebf-ea99a52b7970

📥 Commits

Reviewing files that changed from the base of the PR and between 150a58c and b8f904b.

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

@openshift-ci-robot
Copy link
Copy Markdown

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

@Chandan9112
Copy link
Copy Markdown
Author

/retest

1 similar comment
@Chandan9112
Copy link
Copy Markdown
Author

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 28, 2026

@Chandan9112: all tests passed!

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.

@openshift-trt
Copy link
Copy Markdown

openshift-trt bot commented Mar 28, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: b8f904b

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-aws-ovn-fips High - "Store build results into a layer on top of tools and save as tools-openstack" is a new test that was not present in all runs against the current commit.
pull-ci-openshift-origin-main-e2e-aws-ovn-fips High - "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" is a new test that was not present in all runs against the current commit.
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" is a new test that was not present in all runs against the current commit.
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi High - "Store build results into a layer on top of tools and save as tools-openstack" is a new test that was not present in all runs against the current commit.
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi High - "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" is a new test that was not present in all runs against the current commit.

New tests seen in this PR at sha: b8f904b

  • "Store build results into a layer on top of tools and save as tools-openstack" [Total: 7, Pass: 7, Fail: 0, Flake: 0]
  • "[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager [OTP] validate cgroupv2 is default [Suite:openshift/conformance/parallel]" [Total: 12, Pass: 12, Fail: 0, Flake: 0]

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants