Skip to content

OCPNODE-4381: Migrate OCP-38271 from openshift-tests-private#30960

Open
BhargaviGudi wants to merge 1 commit intoopenshift:mainfrom
BhargaviGudi:migrate-38271
Open

OCPNODE-4381: Migrate OCP-38271 from openshift-tests-private#30960
BhargaviGudi wants to merge 1 commit intoopenshift:mainfrom
BhargaviGudi:migrate-38271

Conversation

@BhargaviGudi
Copy link
Copy Markdown
Contributor

@BhargaviGudi BhargaviGudi commented Apr 6, 2026

Summary Adds test to verify init containers do not restart when the exited init container is removed from the node.

Changes

  • Add test/extended/testdata/node/node_e2e/pod-initContainer.yaml - Pod template with init container
  • Add helper functions to test/extended/node/node_utils.go:
    • PodInitConDescription struct with methods: Create(), Delete(), ContainerExit(), DeleteInitContainer(), InitContainerNotRestart()
    • PodStatus() function to check pod readiness
  • Add test in test/extended/node/node_e2e/node.go:
  • [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]

Original author: minmli@redhat.com
Migrated by: bgudi@redhat.com

tested manually on 4.22.0-0.nightly-2026-04-06-051707

  [sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]
  github.com/openshift/origin/test/extended/node/node_e2e/node.go:164
    STEP: Creating a kubernetes client @ 04/08/26 17:51:05.821
  I0408 17:51:05.823073 3140600 discovery.go:214] Invalidating discovery information
  I0408 17:51:09.779271 3140600 client.go:293] configPath is now "/tmp/configfile4075894250"
  I0408 17:51:09.779320 3140600 client.go:368] The user is now "e2e-test-node-initcontainer-fztfw-user"
  I0408 17:51:09.779330 3140600 client.go:370] Creating project "e2e-test-node-initcontainer-fztfw"
  I0408 17:51:10.390845 3140600 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-fztfw" ...
  I0408 17:51:11.576268 3140600 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
  I0408 17:51:11.819825 3140600 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
  I0408 17:51:12.400689 3140600 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
  I0408 17:51:13.051667 3140600 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
  I0408 17:51:13.687986 3140600 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
  I0408 17:51:13.936306 3140600 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
  I0408 17:51:14.190899 3140600 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
  I0408 17:51:16.161936 3140600 client.go:469] Project "e2e-test-node-initcontainer-fztfw" has been fully provisioned.
  I0408 17:51:18.164679 3140600 framework.go:2330] [precondition-check] checking if cluster is MicroShift
  I0408 17:51:18.403844 3140600 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
    STEP: Test for case OCP-38271 @ 04/08/26 17:51:18.403
  I0408 17:51:22.859554 3140600 client.go:293] configPath is now "/tmp/configfile2728535966"
  I0408 17:51:22.859595 3140600 client.go:368] The user is now "e2e-test-node-initcontainer-xw49d-user"
  I0408 17:51:22.859602 3140600 client.go:370] Creating project "e2e-test-node-initcontainer-xw49d"
  I0408 17:51:23.228723 3140600 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-xw49d" ...
  I0408 17:51:25.039634 3140600 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
  I0408 17:51:25.406429 3140600 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
  I0408 17:51:26.038125 3140600 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
  I0408 17:51:26.667111 3140600 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
  I0408 17:51:27.288762 3140600 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
  I0408 17:51:27.528494 3140600 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
  I0408 17:51:27.871855 3140600 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
  I0408 17:51:29.723241 3140600 client.go:469] Project "e2e-test-node-initcontainer-xw49d" has been fully provisioned.
    STEP: Create a pod with init container @ 04/08/26 17:51:29.723
    STEP: Check pod status @ 04/08/26 17:51:29.995
    STEP: Check init container exit normally @ 04/08/26 17:51:34.819
  I0408 17:51:40.129708 3140600 node.go:236] Init container exited with code 0
    STEP: Get node where pod is running @ 04/08/26 17:51:40.129
    STEP: Get init container ID from pod status @ 04/08/26 17:51:40.602
    STEP: Delete init container from node @ 04/08/26 17:51:40.602
  I0408 17:52:00.218044 3140600 node.go:271] Container deletion output: ed0e810d3307ec87525a6c298f6984cf5c3f84a80483195e113fd77cead7955e
    STEP: Check init container not restart again @ 04/08/26 17:52:00.218
  I0408 17:52:05.466945 3140600 node.go:287] Init container has not restarted
  I0408 17:52:10.478187 3140600 node.go:287] Init container has not restarted
  I0408 17:52:15.462079 3140600 node.go:287] Init container has not restarted
  I0408 17:52:20.570873 3140600 node.go:287] Init container has not restarted
  I0408 17:52:25.642757 3140600 node.go:287] Init container has not restarted
  I0408 17:52:31.225941 3140600 node.go:287] Init container has not restarted
  I0408 17:52:35.485849 3140600 node.go:287] Init container has not restarted
  I0408 17:52:40.473818 3140600 node.go:287] Init container has not restarted
  I0408 17:52:45.474525 3140600 node.go:287] Init container has not restarted
  I0408 17:52:50.503752 3140600 node.go:287] Init container has not restarted
  I0408 17:52:55.763382 3140600 node.go:287] Init container has not restarted
  I0408 17:53:00.506225 3140600 node.go:287] Init container has not restarted
  I0408 17:53:00.744589 3140600 node.go:287] Init container has not restarted
  I0408 17:53:02.803754 3140600 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-fztfw-user}, err: <nil>
  I0408 17:53:03.057456 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-fztfw}, err: <nil>
  I0408 17:53:03.300012 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~DOn8n1Vqz9ZgZGjD8DW-5G-wH_UnrgvhQiCDJQksN6E}, err: <nil>
  I0408 17:53:03.541164 3140600 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-xw49d-user}, err: <nil>
  I0408 17:53:03.786028 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-xw49d}, err: <nil>
  I0408 17:53:04.029258 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~VWK1PIkbSdZflfdpxxX0ZBUxOSjO6QkemzmHFqR3UrI}, err: <nil>
    STEP: Destroying namespace "e2e-test-node-initcontainer-fztfw" for this suite. @ 04/08/26 17:53:04.029
    STEP: Destroying namespace "e2e-test-node-initcontainer-xw49d" for this suite. @ 04/08/26 17:53:04.333
  • [119.399 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 119.399 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 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 Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 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

Replaced immediate MicroShift detection with a retrying check that fails after retries; added a new Ginkgo suite and an OCP-38271 test that creates a Pod with an init container, removes the init container via CRI on the node, and verifies the init container does not restart.

Changes

Cohort / File(s) Summary
Node e2e changes
test/extended/node/node_e2e/node.go
Replaced exutil.IsMicroShiftCluster(...) immediate-fail with a wait.Poll retry loop and g.Fail after retries. Added imports for context, fmt, regexp, corev1, metav1, e2epod. Added new Ginkgo suite "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota" and a new OCP-38271 test that: creates a Pod with an init container + long-running main container; waits for Pod Running and init container termination; extracts the init container ContainerID from pod.Status.InitContainerStatuses; removes the container via crictl rm executed with nodeutils.ExecOnNodeWithChroot; polls to assert init-container RestartCount does not increase (expects wait.ErrWaitTimeout if no restart).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

✨ 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 openshift-ci bot requested review from bertinatto and cpmeadors April 6, 2026 09:48
@openshift-ci openshift-ci bot added the e2e-images-update Related to images used by e2e tests label Apr 6, 2026
@BhargaviGudi BhargaviGudi changed the title WIP Migrate OCP-38271 from openshift-tests-private WIP OCPNODE-4381: Migrate OCP-38271 from openshift-tests-private Apr 6, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 6, 2026

@BhargaviGudi: This pull request references OCPNODE-4381 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:

Summary Adds test to verify init containers do not restart when the exited init container is removed from the node.

Changes

  • Add test/extended/testdata/node/node_e2e/pod-initContainer.yaml - Pod template with init container
  • Add helper functions to test/extended/node/node_utils.go:
    • PodInitConDescription struct with methods: Create(), Delete(), ContainerExit(), DeleteInitContainer(), InitContainerNotRestart()
    • PodStatus() function to check pod readiness
  • Add test in test/extended/node/node_e2e/node.go:
  • [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]

Original author: minmli@redhat.com
Migrated by: bgudi@redhat.com

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.

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/test verify

@BhargaviGudi BhargaviGudi force-pushed the migrate-38271 branch 2 times, most recently from f9f4ebe to 44944db Compare April 7, 2026 07:02
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 7, 2026

@BhargaviGudi: This pull request references OCPNODE-4381 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:

Summary Adds test to verify init containers do not restart when the exited init container is removed from the node.

Changes

  • Add test/extended/testdata/node/node_e2e/pod-initContainer.yaml - Pod template with init container
  • Add helper functions to test/extended/node/node_utils.go:
    • PodInitConDescription struct with methods: Create(), Delete(), ContainerExit(), DeleteInitContainer(), InitContainerNotRestart()
    • PodStatus() function to check pod readiness
  • Add test in test/extended/node/node_e2e/node.go:
  • [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]

Original author: minmli@redhat.com
Migrated by: bgudi@redhat.com

tested manually on 4.22.0-0.nightly-2026-04-06-051707

 Will run 1 of 1 specs
 ------------------------------
 [sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readines,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:127
   STEP: Creating a kubernetes client @ 04/07/26 12:32:54.16
 I0407 12:32:54.160919 2511173 discovery.go:214] Invalidating discovery information
 I0407 12:32:58.969829 2511173 client.go:293] configPath is now "/tmp/configfile160890699"
 I0407 12:32:58.969848 2511173 client.go:368] The user is now "e2e-test-node-initcontainer-kfs2p-user"
 I0407 12:32:58.969853 2511173 client.go:370] Creating project "e2e-test-node-initcontainer-kfs2p"
 I0407 12:32:59.280133 2511173 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-kfs2p" ...
 I0407 12:33:00.502528 2511173 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0407 12:33:01.227008 2511173 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0407 12:33:01.931634 2511173 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0407 12:33:02.494910 2511173 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0407 12:33:03.078842 2511173 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0407 12:33:03.341313 2511173 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0407 12:33:03.580906 2511173 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0407 12:33:05.992878 2511173 client.go:469] Project "e2e-test-node-initcontainer-kfs2p" has been fully provisioned.
 I0407 12:33:05.994313 2511173 framework.go:2330] [precondition-check] checking if cluster is MicroShift
 I0407 12:33:06.265290 2511173 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: Test for case OCP-38271 @ 04/07/26 12:33:06.266
 I0407 12:33:10.518624 2511173 client.go:293] configPath is now "/tmp/configfile3905948318"
 I0407 12:33:10.518653 2511173 client.go:368] The user is now "e2e-test-node-initcontainer-xm2hp-user"
 I0407 12:33:10.518661 2511173 client.go:370] Creating project "e2e-test-node-initcontainer-xm2hp"
 I0407 12:33:11.847825 2511173 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-xm2hp" ...
 I0407 12:33:13.600189 2511173 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0407 12:33:13.870908 2511173 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0407 12:33:14.532749 2511173 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0407 12:33:15.123094 2511173 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0407 12:33:15.833134 2511173 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0407 12:33:16.249662 2511173 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0407 12:33:16.520866 2511173 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0407 12:33:18.639586 2511173 client.go:469] Project "e2e-test-node-initcontainer-xm2hp" has been fully provisioned.
   STEP: Create a pod with init container @ 04/07/26 12:33:18.639
 I0407 12:33:23.467454 2511173 template.go:146] the file of resource is /tmp/e2e-test-node-initcontainer-xm2hp-9kwvufepconfig.json
 pod/initcon-pod created
   STEP: Check pod status @ 04/07/26 12:33:25.029
 I0407 12:33:25.029336 2511173 node_utils.go:746] check if pod is available
 I0407 12:33:31.493902 2511173 node_utils.go:751] Pod is running and container is Ready!
   STEP: Check init container exit normally @ 04/07/26 12:33:31.493
 I0407 12:33:34.889806 2511173 node_utils.go:702] The initContainer status is Completed
 I0407 12:33:34.889857 2511173 node_utils.go:705] The initContainer exit normally
   STEP: Delete init container @ 04/07/26 12:33:34.889
 I0407 12:33:37.142822 2511173 node_utils.go:718] The containerID is cri-o://b78a52f615505afce8333f2628f8d9210de1587cb2d869d4a6ff628972d42c2c
 I0407 12:33:37.142862 2511173 node_utils.go:720] The initContainerID is b78a52f615505afce8333f2628f8d9210de1587cb2d869d4a6ff628972d42c2c
 namespace/e2e-test-node-initcontainer-xm2hp labeled
 namespace/e2e-test-node-initcontainer-xm2hp unlabeled
   STEP: Check init container not restart again @ 04/07/26 12:33:45.91
 I0407 12:36:49.266671 2511173 node_utils.go:730] The /mnt/data/test: Defaulted container "my-container" out of: my-container, inittest (init)
 running
 I0407 12:36:49.266761 2511173 node_utils.go:737] initContainer not restart
 pod "initcon-pod" deleted
 I0407 12:37:22.201454 2511173 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-kfs2p-user}, err: <nil>
 I0407 12:37:22.437605 2511173 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-kfs2p}, err: <nil>
 I0407 12:37:23.655331 2511173 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~BIJzrGxVFeRxkJBZo0IE-0WN3hCn9mpuXijr7YTBVAs}, err: <nil>
 I0407 12:37:23.897875 2511173 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-xm2hp-user}, err: <nil>
 I0407 12:37:24.149044 2511173 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-xm2hp}, err: <nil>
 I0407 12:37:24.400300 2511173 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~3drhEENVw6hKI7pXXs0vQA3QVhLJmElPteMRfC2L3v8}, err: <nil>
   STEP: Destroying namespace "e2e-test-node-initcontainer-kfs2p" for this suite. @ 04/07/26 12:37:24.4
   STEP: Destroying namespace "e2e-test-node-initcontainer-xm2hp" for this suite. @ 04/07/26 12:37:24.649
 • [270.749 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 270.749 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.

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/verified by @BhargaviGudi

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 7, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This PR has been marked as verified by @BhargaviGudi.

Details

In response to this:

/verified by @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.

@BhargaviGudi BhargaviGudi changed the title WIP OCPNODE-4381: Migrate OCP-38271 from openshift-tests-private OCPNODE-4381: Migrate OCP-38271 from openshift-tests-private Apr 7, 2026
@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 Apr 7, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 7, 2026

@BhargaviGudi: This pull request references OCPNODE-4381 which is a valid jira issue.

Details

In response to this:

Summary Adds test to verify init containers do not restart when the exited init container is removed from the node.

Changes

  • Add test/extended/testdata/node/node_e2e/pod-initContainer.yaml - Pod template with init container
  • Add helper functions to test/extended/node/node_utils.go:
    • PodInitConDescription struct with methods: Create(), Delete(), ContainerExit(), DeleteInitContainer(), InitContainerNotRestart()
    • PodStatus() function to check pod readiness
  • Add test in test/extended/node/node_e2e/node.go:
  • [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]

Original author: minmli@redhat.com
Migrated by: bgudi@redhat.com

tested manually on 4.22.0-0.nightly-2026-04-06-051707

 [sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readines,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:132
   STEP: Creating a kubernetes client @ 04/07/26 15:42:34.99
 I0407 15:42:34.991250 2683548 discovery.go:214] Invalidating discovery information
 I0407 15:42:39.243543 2683548 client.go:293] configPath is now "/tmp/configfile3855134934"
 I0407 15:42:39.243585 2683548 client.go:368] The user is now "e2e-test-node-initcontainer-vkd4d-user"
 I0407 15:42:39.243594 2683548 client.go:370] Creating project "e2e-test-node-initcontainer-vkd4d"
 I0407 15:42:40.691446 2683548 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-vkd4d" ...
 I0407 15:42:41.830235 2683548 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0407 15:42:42.111126 2683548 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0407 15:42:44.974897 2683548 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0407 15:42:46.205469 2683548 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0407 15:42:46.806100 2683548 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0407 15:42:47.226829 2683548 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0407 15:42:47.639404 2683548 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0407 15:42:49.632918 2683548 client.go:469] Project "e2e-test-node-initcontainer-vkd4d" has been fully provisioned.
 I0407 15:42:49.634001 2683548 framework.go:2330] [precondition-check] checking if cluster is MicroShift
 I0407 15:42:49.858322 2683548 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: Test for case OCP-38271 @ 04/07/26 15:42:49.858
 I0407 15:42:53.986416 2683548 client.go:293] configPath is now "/tmp/configfile57604844"
 I0407 15:42:53.986465 2683548 client.go:368] The user is now "e2e-test-node-initcontainer-7cc7f-user"
 I0407 15:42:53.986474 2683548 client.go:370] Creating project "e2e-test-node-initcontainer-7cc7f"
 I0407 15:42:54.364671 2683548 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-7cc7f" ...
 I0407 15:42:55.812977 2683548 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0407 15:42:56.074192 2683548 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0407 15:42:56.641302 2683548 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0407 15:42:57.246370 2683548 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0407 15:42:58.181456 2683548 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0407 15:42:58.453551 2683548 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0407 15:42:58.691910 2683548 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0407 15:43:01.974026 2683548 client.go:469] Project "e2e-test-node-initcontainer-7cc7f" has been fully provisioned.
   STEP: Create a pod with init container @ 04/07/26 15:43:01.974
   STEP: Check pod status @ 04/07/26 15:43:02.383
   STEP: Check init container exit normally @ 04/07/26 15:43:07.269
 I0407 15:43:13.034515 2683548 node.go:204] Init container exited with code 0
   STEP: Get node where pod is running @ 04/07/26 15:43:13.034
   STEP: Get init container ID from pod status @ 04/07/26 15:43:13.408
   STEP: Delete init container from node @ 04/07/26 15:43:13.408
 I0407 15:43:16.964246 2683548 node.go:239] Container deletion output: 1edf2cf9948c161d69b57e0c6cba2858f53af2483c00212be69baebc8f391ca9
   STEP: Check init container not restart again @ 04/07/26 15:43:16.964
 I0407 15:43:22.275493 2683548 node.go:255] Init container has not restarted
 I0407 15:43:22.783492 2683548 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-vkd4d-user}, err: <nil>
 I0407 15:43:23.059018 2683548 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-vkd4d}, err: <nil>
 I0407 15:43:23.291689 2683548 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~4zwghso_ATUPoCGL0QbFnEj1L3Sl7dTbulxaUP5ikIs}, err: <nil>
 I0407 15:43:23.532241 2683548 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-7cc7f-user}, err: <nil>
 I0407 15:43:23.813310 2683548 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-7cc7f}, err: <nil>
 I0407 15:43:24.049653 2683548 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~fKDLHmwN96xMJxbYazWMJ2J0BxIPZcvitRIFX78xaKE}, err: <nil>
   STEP: Destroying namespace "e2e-test-node-initcontainer-vkd4d" for this suite. @ 04/07/26 15:43:24.049
   STEP: Destroying namespace "e2e-test-node-initcontainer-7cc7f" for this suite. @ 04/07/26 15:43:24.315
 • [50.042 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 50.042 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 openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Apr 7, 2026
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 (2)
test/extended/node/node_e2e/node.go (2)

151-151: Use absolute path /bin/sh instead of relative bin/sh.

The command uses a relative path bin/sh which only works because the container's default working directory is /. Using the absolute path /bin/sh is the standard convention and avoids potential issues if WorkingDir is ever specified.

♻️ Suggested fix
-						Command: []string{"bin/sh", "-ec", "echo running >> /mnt/data/test"},
+						Command: []string{"/bin/sh", "-ec", "echo running >> /mnt/data/test"},
-						Command: []string{"bin/sh", "-c", "sleep 3600"},
+						Command: []string{"/bin/sh", "-c", "sleep 3600"},

Also applies to: 164-164

🤖 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` at line 151, Replace the relative shell
path in the container Command arrays with the absolute path; specifically update
the Command entry in the container spec(s) in node.go (the Command:
[]string{"bin/sh", "-ec", ...} occurrences) to use "/bin/sh" instead of "bin/sh"
(apply the same change to the other occurrence mentioned).

116-116: Remove unnecessary defer g.GinkgoRecover().

GinkgoRecover() is designed for recovering panics in goroutines spawned within tests. At the Describe level, this defer executes when the Describe function returns (before any tests run), serving no purpose. Ginkgo already has built-in panic recovery for test blocks.

♻️ Suggested fix
 var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readines,quota", func() {
-	defer g.GinkgoRecover()
-
 	var (
🤖 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` at line 116, Remove the unnecessary
defer g.GinkgoRecover() call from the Describe-level scope: the defer is only
useful for recovering panics in goroutines spawned inside test blocks, and at
the Describe level it runs too early and is redundant since Ginkgo already
handles test panic recovery. Locate the defer g.GinkgoRecover() invocation
(inside the Describe/registration setup in node.go) and delete that single line
so no external panic recovery is deferred at describe initialization.
🤖 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 241-258: The test currently returns success as soon as
RestartCount==0, which allows a race; change the wait.Poll predicate so it does
NOT return success when RestartCount==0 but instead keeps polling for the full
duration: inside the func passed to wait.Poll iterate
pod.Status.InitContainerStatuses for the "inittest" entry and if RestartCount>0
immediately return true, fmt.Errorf("init container restarted"); otherwise
return false, nil so polling continues; after wait.Poll, assert that the error
is a timeout (wait.ErrWaitTimeout) and fail if err is nil or a different error
(i.e. a restart was detected) — update the expectation that currently uses
o.Expect(err).NotTo(o.HaveOccurred()) accordingly.

---

Nitpick comments:
In `@test/extended/node/node_e2e/node.go`:
- Line 151: Replace the relative shell path in the container Command arrays with
the absolute path; specifically update the Command entry in the container
spec(s) in node.go (the Command: []string{"bin/sh", "-ec", ...} occurrences) to
use "/bin/sh" instead of "bin/sh" (apply the same change to the other occurrence
mentioned).
- Line 116: Remove the unnecessary defer g.GinkgoRecover() call from the
Describe-level scope: the defer is only useful for recovering panics in
goroutines spawned inside test blocks, and at the Describe level it runs too
early and is redundant since Ginkgo already handles test panic recovery. Locate
the defer g.GinkgoRecover() invocation (inside the Describe/registration setup
in node.go) and delete that single line so no external panic recovery is
deferred at describe initialization.
🪄 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: 9d5d9835-9727-4042-b00a-649da2b71dd8

📥 Commits

Reviewing files that changed from the base of the PR and between c77ff4a and 3c8a2c2.

📒 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

@openshift-trt
Copy link
Copy Markdown

openshift-trt bot commented Apr 7, 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: 3c8a2c2

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readines,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: 3c8a2c2

  • "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readines,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 4, Fail: 1, Flake: 0]

@cpmeadors
Copy link
Copy Markdown
Contributor

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 7, 2026

@cpmeadors: This pull request references OCPNODE-4381 which is a valid jira issue.

Details

In response to this:

/jira refresh

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.

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/retest-required

@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-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 8, 2026

@BhargaviGudi: This pull request references OCPNODE-4381 which is a valid jira issue.

Details

In response to this:

Summary Adds test to verify init containers do not restart when the exited init container is removed from the node.

Changes

  • Add test/extended/testdata/node/node_e2e/pod-initContainer.yaml - Pod template with init container
  • Add helper functions to test/extended/node/node_utils.go:
    • PodInitConDescription struct with methods: Create(), Delete(), ContainerExit(), DeleteInitContainer(), InitContainerNotRestart()
    • PodStatus() function to check pod readiness
  • Add test in test/extended/node/node_e2e/node.go:
  • [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]

Original author: minmli@redhat.com
Migrated by: bgudi@redhat.com

tested manually on 4.22.0-0.nightly-2026-04-06-051707

 [sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271]
 github.com/openshift/origin/test/extended/node/node_e2e/node.go:164
   STEP: Creating a kubernetes client @ 04/08/26 17:51:05.821
 I0408 17:51:05.823073 3140600 discovery.go:214] Invalidating discovery information
 I0408 17:51:09.779271 3140600 client.go:293] configPath is now "/tmp/configfile4075894250"
 I0408 17:51:09.779320 3140600 client.go:368] The user is now "e2e-test-node-initcontainer-fztfw-user"
 I0408 17:51:09.779330 3140600 client.go:370] Creating project "e2e-test-node-initcontainer-fztfw"
 I0408 17:51:10.390845 3140600 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-fztfw" ...
 I0408 17:51:11.576268 3140600 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0408 17:51:11.819825 3140600 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0408 17:51:12.400689 3140600 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0408 17:51:13.051667 3140600 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0408 17:51:13.687986 3140600 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0408 17:51:13.936306 3140600 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0408 17:51:14.190899 3140600 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0408 17:51:16.161936 3140600 client.go:469] Project "e2e-test-node-initcontainer-fztfw" has been fully provisioned.
 I0408 17:51:18.164679 3140600 framework.go:2330] [precondition-check] checking if cluster is MicroShift
 I0408 17:51:18.403844 3140600 framework.go:2353] IsMicroShiftCluster: microshift-version configmap not found, not MicroShift
   STEP: Test for case OCP-38271 @ 04/08/26 17:51:18.403
 I0408 17:51:22.859554 3140600 client.go:293] configPath is now "/tmp/configfile2728535966"
 I0408 17:51:22.859595 3140600 client.go:368] The user is now "e2e-test-node-initcontainer-xw49d-user"
 I0408 17:51:22.859602 3140600 client.go:370] Creating project "e2e-test-node-initcontainer-xw49d"
 I0408 17:51:23.228723 3140600 client.go:378] Waiting on permissions in project "e2e-test-node-initcontainer-xw49d" ...
 I0408 17:51:25.039634 3140600 client.go:407] DeploymentConfig capability is enabled, adding 'deployer' SA to the list of default SAs
 I0408 17:51:25.406429 3140600 client.go:422] Waiting for ServiceAccount "default" to be provisioned...
 I0408 17:51:26.038125 3140600 client.go:422] Waiting for ServiceAccount "builder" to be provisioned...
 I0408 17:51:26.667111 3140600 client.go:422] Waiting for ServiceAccount "deployer" to be provisioned...
 I0408 17:51:27.288762 3140600 client.go:432] Waiting for RoleBinding "system:image-pullers" to be provisioned...
 I0408 17:51:27.528494 3140600 client.go:432] Waiting for RoleBinding "system:image-builders" to be provisioned...
 I0408 17:51:27.871855 3140600 client.go:432] Waiting for RoleBinding "system:deployers" to be provisioned...
 I0408 17:51:29.723241 3140600 client.go:469] Project "e2e-test-node-initcontainer-xw49d" has been fully provisioned.
   STEP: Create a pod with init container @ 04/08/26 17:51:29.723
   STEP: Check pod status @ 04/08/26 17:51:29.995
   STEP: Check init container exit normally @ 04/08/26 17:51:34.819
 I0408 17:51:40.129708 3140600 node.go:236] Init container exited with code 0
   STEP: Get node where pod is running @ 04/08/26 17:51:40.129
   STEP: Get init container ID from pod status @ 04/08/26 17:51:40.602
   STEP: Delete init container from node @ 04/08/26 17:51:40.602
 I0408 17:52:00.218044 3140600 node.go:271] Container deletion output: ed0e810d3307ec87525a6c298f6984cf5c3f84a80483195e113fd77cead7955e
   STEP: Check init container not restart again @ 04/08/26 17:52:00.218
 I0408 17:52:05.466945 3140600 node.go:287] Init container has not restarted
 I0408 17:52:10.478187 3140600 node.go:287] Init container has not restarted
 I0408 17:52:15.462079 3140600 node.go:287] Init container has not restarted
 I0408 17:52:20.570873 3140600 node.go:287] Init container has not restarted
 I0408 17:52:25.642757 3140600 node.go:287] Init container has not restarted
 I0408 17:52:31.225941 3140600 node.go:287] Init container has not restarted
 I0408 17:52:35.485849 3140600 node.go:287] Init container has not restarted
 I0408 17:52:40.473818 3140600 node.go:287] Init container has not restarted
 I0408 17:52:45.474525 3140600 node.go:287] Init container has not restarted
 I0408 17:52:50.503752 3140600 node.go:287] Init container has not restarted
 I0408 17:52:55.763382 3140600 node.go:287] Init container has not restarted
 I0408 17:53:00.506225 3140600 node.go:287] Init container has not restarted
 I0408 17:53:00.744589 3140600 node.go:287] Init container has not restarted
 I0408 17:53:02.803754 3140600 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-fztfw-user}, err: <nil>
 I0408 17:53:03.057456 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-fztfw}, err: <nil>
 I0408 17:53:03.300012 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~DOn8n1Vqz9ZgZGjD8DW-5G-wH_UnrgvhQiCDJQksN6E}, err: <nil>
 I0408 17:53:03.541164 3140600 client.go:689] Deleted {user.openshift.io/v1, Resource=users  e2e-test-node-initcontainer-xw49d-user}, err: <nil>
 I0408 17:53:03.786028 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthclients  e2e-client-e2e-test-node-initcontainer-xw49d}, err: <nil>
 I0408 17:53:04.029258 3140600 client.go:689] Deleted {oauth.openshift.io/v1, Resource=oauthaccesstokens  sha256~VWK1PIkbSdZflfdpxxX0ZBUxOSjO6QkemzmHFqR3UrI}, err: <nil>
   STEP: Destroying namespace "e2e-test-node-initcontainer-fztfw" for this suite. @ 04/08/26 17:53:04.029
   STEP: Destroying namespace "e2e-test-node-initcontainer-xw49d" for this suite. @ 04/08/26 17:53:04.333
 • [119.399 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 119.399 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.

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

Ran testcase manually.
/verified by @BhargaviGudi

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@BhargaviGudi: This PR has been marked as verified by @BhargaviGudi.

Details

In response to this:

Ran testcase manually.
/verified by @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.

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Apr 8, 2026
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 (2)
test/extended/node/node_e2e/node.go (2)

170-171: defer g.GinkgoRecover() at Describe level is unnecessary.

GinkgoRecover is designed to catch panics in goroutines spawned within tests. At the Describe block level, Ginkgo already provides built-in panic recovery. This defer statement has no practical effect here and can be removed.

♻️ Suggested removal
 var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota", func() {
-	defer g.GinkgoRecover()
-
 	var (
 		oc = exutil.NewCLI("node-initcontainer")
 	)
🤖 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 170 - 171, Remove the
unnecessary panic-recovery defer at the Describe block: delete the defer
g.GinkgoRecover() call that immediately follows the g.Describe("[sig-node] ...",
func() { declaration; keep the Describe block and its body intact (the symbol to
change is the g.Describe(...) anonymous func containing defer g.GinkgoRecover())
so Ginkgo’s built-in panic recovery handles panics instead of the redundant
defer.

31-53: Outer retry may be unnecessary given IsMicroShiftCluster already retries internally.

Per the implementation in test/extended/util/framework.go, IsMicroShiftCluster already contains an internal wait.PollUntilContextTimeout that retries for up to 5 minutes and always returns (bool, nil) — it does not propagate errors. The outer 30-second retry loop here will typically complete on the first iteration.

This defensive approach doesn't cause functional issues, but you may consider simplifying if you're confident in the internal retry behavior.

🤖 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 31 - 53, The outer
wait.Poll retry around exutil.IsMicroShiftCluster in the g.BeforeEach is
redundant because IsMicroShiftCluster already retries internally; remove the
wait.Poll block, call exutil.IsMicroShiftCluster(oc.AdminKubeClient()) directly
to set isMicroShift, drop pollErr and the extra err handling/logging tied to
that poll, and then keep the existing check that calls g.Skip("Skipping test on
MicroShift cluster...") when isMicroShift is true (adjust handling of the
returned error from IsMicroShiftCluster according to its signature in
test/extended/util/framework.go).
🤖 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`:
- Line 222: Replace the relative shell path used in the container Command fields
from "bin/sh" to the absolute "/bin/sh" to ensure reliable execution; update the
Command entries that currently read Command: []string{"bin/sh", "-ec", "echo
running >> /mnt/data/test"} (and the similar occurrence later in the file) so
they use "/bin/sh" instead.

---

Nitpick comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 170-171: Remove the unnecessary panic-recovery defer at the
Describe block: delete the defer g.GinkgoRecover() call that immediately follows
the g.Describe("[sig-node] ...", func() { declaration; keep the Describe block
and its body intact (the symbol to change is the g.Describe(...) anonymous func
containing defer g.GinkgoRecover()) so Ginkgo’s built-in panic recovery handles
panics instead of the redundant defer.
- Around line 31-53: The outer wait.Poll retry around exutil.IsMicroShiftCluster
in the g.BeforeEach is redundant because IsMicroShiftCluster already retries
internally; remove the wait.Poll block, call
exutil.IsMicroShiftCluster(oc.AdminKubeClient()) directly to set isMicroShift,
drop pollErr and the extra err handling/logging tied to that poll, and then keep
the existing check that calls g.Skip("Skipping test on MicroShift cluster...")
when isMicroShift is true (adjust handling of the returned error from
IsMicroShiftCluster according to its signature in
test/extended/util/framework.go).
🪄 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: 870064cf-6048-4013-8e0e-0ff27e627c94

📥 Commits

Reviewing files that changed from the base of the PR and between 8817055 and 0fcaf4b.

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

@cpmeadors
Copy link
Copy Markdown
Contributor

/lgtm

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

openshift-ci bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BhargaviGudi, cpmeadors

The full list of commands accepted by this bot can be found here.

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

New changes are detected. LGTM label has been removed.

@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 Apr 8, 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: 7c17571

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: 7c17571

  • "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 4, Fail: 1, Flake: 0]

@BhargaviGudi
Copy link
Copy Markdown
Contributor Author

/test e2e-aws-ovn-fips
/test e2e-metal-ipi-ovn-ipv6

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)

306-308: Avoid bash -c for crictl rm

Line 307 interpolates actualContainerID into a shell command even though nodeutils.ExecOnNodeWithChroot already accepts argv. Passing the arguments directly is safer and avoids quoting issues in this privileged path.

Suggested change
-		deleteCmd := fmt.Sprintf("crictl rm %s", actualContainerID)
-		output, err := nodeutils.ExecOnNodeWithChroot(oc, nodeName, "/bin/bash", "-c", deleteCmd)
+		output, err := nodeutils.ExecOnNodeWithChroot(oc, nodeName, "crictl", "rm", actualContainerID)

sprintf then drops out as well.

🤖 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 306 - 308, The test
currently builds a shell string via fmt.Sprintf (deleteCmd) and invokes
nodeutils.ExecOnNodeWithChroot("/bin/bash", "-c", deleteCmd), which risks
quoting issues and is unnecessary because ExecOnNodeWithChroot accepts argv;
change the call to pass crictl and the container ID as separate arguments (e.g.,
nodeutils.ExecOnNodeWithChroot(oc, nodeName, "crictl", "rm",
actualContainerID)), remove the fmt.Sprintf/deleteCmd variable and the
"/bin/bash", "-c" wrapper, and handle the returned output and err the same way.
🤖 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 35-48: The outer retry using wait.Poll around
exutil.IsMicroShiftCluster is ineffective because IsMicroShiftCluster already
polls internally and suppresses timeouts; remove the outer wait.Poll and call
exutil.IsMicroShiftCluster(oc.AdminKubeClient()) directly, then check its
returned err and isMicroShift to decide failure (use pollErr variable logic but
replace it with the direct call result), or alternatively modify
exutil.IsMicroShiftCluster to return an error on timeout so the outer wait.Poll
can meaningfully retry; apply the same change to the duplicate occurrence that
references the same functions/variables (exutil.IsMicroShiftCluster, wait.Poll,
isMicroShift, pollErr).

---

Nitpick comments:
In `@test/extended/node/node_e2e/node.go`:
- Around line 306-308: The test currently builds a shell string via fmt.Sprintf
(deleteCmd) and invokes nodeutils.ExecOnNodeWithChroot("/bin/bash", "-c",
deleteCmd), which risks quoting issues and is unnecessary because
ExecOnNodeWithChroot accepts argv; change the call to pass crictl and the
container ID as separate arguments (e.g., nodeutils.ExecOnNodeWithChroot(oc,
nodeName, "crictl", "rm", actualContainerID)), remove the fmt.Sprintf/deleteCmd
variable and the "/bin/bash", "-c" wrapper, and handle the returned output and
err the same way.
🪄 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: 7dbd6b05-b92d-4a2c-9598-dfb720e118b7

📥 Commits

Reviewing files that changed from the base of the PR and between 7c17571 and ece1818.

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

Comment on lines +35 to +48
// Retry check for robustness - OpenShift should eventually respond
pollErr := wait.Poll(2*time.Second, 30*time.Second, func() (bool, error) {
isMicroShift, err = exutil.IsMicroShiftCluster(oc.AdminKubeClient())
if err != nil {
e2e.Logf("Failed to check if cluster is MicroShift: %v, retrying...", err)
return false, nil
}
return true, nil
})

if pollErr != nil {
e2e.Logf("Setup failed: unable to determine if cluster is MicroShift after retries: %v", err)
g.Fail("Setup failed: unable to determine cluster type - this is an infrastructure/connectivity issue, not a test failure")
}
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 MicroShift retry wrapper never actually retries or fails setup

Line 37 / Line 184 call exutil.IsMicroShiftCluster, but that helper already does its own 5-minute poll and always returns err == nil even on timeout (test/extended/util/framework.go:2327-2358). That means this outer 30-second wait.Poll can still block for ~5 minutes per call, then return success with isMicroShift == false, so Line 45 / Line 192's setup-failure path is effectively dead.

Either call the helper once, or change the helper to surface API failures and own the retry there; in its current form this adds long setup stalls without giving the clearer setup-vs-test failure behavior the PR is trying to introduce.

Also applies to: 182-195

🤖 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 35 - 48, The outer retry
using wait.Poll around exutil.IsMicroShiftCluster is ineffective because
IsMicroShiftCluster already polls internally and suppresses timeouts; remove the
outer wait.Poll and call exutil.IsMicroShiftCluster(oc.AdminKubeClient())
directly, then check its returned err and isMicroShift to decide failure (use
pollErr variable logic but replace it with the direct call result), or
alternatively modify exutil.IsMicroShiftCluster to return an error on timeout so
the outer wait.Poll can meaningfully retry; apply the same change to the
duplicate occurrence that references the same functions/variables
(exutil.IsMicroShiftCluster, wait.Poll, isMicroShift, pollErr).

@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

Add test to verify init containers do not restart when removed from node.

- Add pod-initContainer.yaml template

- Add helper functions in node_utils.go

- Add OCP-38271 test in node_e2e/node.go

Author: minmli@redhat.com (original)

Migrated-by: bgudi@redhat.com

Move OCP-38271 test to separate Describe block

Refactor OCP-38271 to use standard origin patterns instead of compat_otp

Fix race condition and Add retry logic and explicit failure for MicroShift cluster check

Resolved typo issue

Resolved gofmt issue

Missing leading slash in shell command path

Use direct crictl args instead of bash -c
@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-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@BhargaviGudi: The following tests 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-fips f68b696 link true /test e2e-aws-ovn-fips
ci/prow/e2e-vsphere-ovn f68b696 link true /test e2e-vsphere-ovn
ci/prow/e2e-metal-ipi-ovn-ipv6 f68b696 link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-gcp-ovn f68b696 link true /test e2e-gcp-ovn
ci/prow/e2e-vsphere-ovn-upi f68b696 link true /test e2e-vsphere-ovn-upi

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 Apr 9, 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: f68b696

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-aws-ovn-fips High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-gcp-ovn High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi High - "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: f68b696

  • "[sig-node] [Jira:Node/Kubelet] NODE initContainer policy,volume,readiness,quota [OTP] Init containers should not restart when the exited init container is removed from node [OCP-38271] [Suite:openshift/conformance/parallel]" [Total: 5, Pass: 0, Fail: 5, Flake: 0]

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. e2e-images-update Related to images used by e2e tests 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.

3 participants