Skip to content

[nodeconfig] Remove CniStateDir from delete test assertion - #4407

Open
ranjithrajaram wants to merge 1 commit into
openshift:masterfrom
ranjithrajaram:cleanup-cni-state-dir-v2
Open

[nodeconfig] Remove CniStateDir from delete test assertion#4407
ranjithrajaram wants to merge 1 commit into
openshift:masterfrom
ranjithrajaram:cleanup-cni-state-dir-v2

Conversation

@ranjithrajaram

@ranjithrajaram ranjithrajaram commented Aug 3, 2026

Copy link
Copy Markdown

The CniStateDir (C:\var\lib\cni) removal in removeDirectories() is best-effort and swallows errors, matching the same pattern used for K8sDir. The checkDirsDoNotExist test was incorrectly asserting that CniStateDir is removed, causing vsphere-proxy-e2e-operator failures on BYOH nodes where the removal may not always succeed.

Remove CniStateDir from checkDirsDoNotExist so the test matches the production contract. Only RequiredDirectories are asserted.

This PR commit updates the actual #4278

Summary by CodeRabbit

  • Tests
    • Updated end-to-end deletion checks to validate only the required directories, improving test accuracy.

The CniStateDir (C:\var\lib\cni) removal in removeDirectories() is
best-effort and swallows errors, matching the same pattern used for
K8sDir. The checkDirsDoNotExist test was incorrectly asserting that
CniStateDir is removed, causing vsphere-proxy-e2e-operator failures
on BYOH nodes where the removal may not always succeed.

Remove CniStateDir from checkDirsDoNotExist so the test matches the
production contract. Only RequiredDirectories are asserted.

Fixes https://issues.redhat.com/browse/OCPBUGS-65625
@openshift-ci
openshift-ci Bot requested review from jrvaldes and wgahnagl August 3, 2026 08:49
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ranjithrajaram
Once this PR has been reviewed and has the lgtm label, please assign jrvaldes for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hi @ranjithrajaram. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The end-to-end deletion test now checks only windows.RequiredDirectories during directory cleanup verification. It no longer includes windows.CniStateDir in the paths passed to the PowerShell command.

Suggested reviewers: jrvaldes

🚥 Pre-merge checks | ✅ 20
✅ Passed checks (20 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Best Practices & Build Tags ✅ Passed Only the e2e test changed; it removes CniStateDir from the assertion loop and adds no ignored errors, panic, nil dereference, or build-tag change. Existing errors use %w.
Security: Secrets, Ssh & Csr ✅ Passed The commit changes only test/e2e/delete_test.go to omit CniStateDir; no credential, SSH, SFTP, certificate, or CSR security code changes are present.
Kubernetes Controller Patterns ✅ Passed The PR changes only test/e2e/delete_test.go; it does not modify reconciliation, status, predicates, finalizers, or owner references.
Windows Service Management ✅ Passed The patch changes only directory assertions; it does not alter Windows service priority, dependencies, descriptions, cleanup, reboot handling, or SCM interactions.
Platform-Specific Requirements ✅ Passed The PR changes only the deletion test; existing vSphere/AWS documentation and Azure/GCP platform wiring remain unchanged, while CniStateDir cleanup remains best effort.
Stable And Deterministic Test Names ✅ Passed The PR changes only directory assertion logic. It adds no Ginkgo declaration or test title; existing Ginkgo titles are static strings.
Test Structure And Quality ✅ Passed The PR only changes delete_test.go to iterate windows.RequiredDirectories; its SSH job wait is bounded, assertions have messages, and existing workload cleanup remains in place.
Microshift Test Compatibility ✅ Passed The PR only modifies an existing Go testing helper; it adds no Ginkgo It, Describe, Context, or When test, so the MicroShift API check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch only edits an existing Go test helper; it adds no Ginkgo tests or new multi-node assumptions, so SNO compatibility checks are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only test/e2e/delete_test.go and removes a directory assertion; it adds no manifests, operator code, controllers, replicas, affinity, selectors, tolerations, or PDBs.
Ote Binary Stdout Contract ✅ Passed The PR changes only a test helper. It adds no process-level stdout writes; the OTE main has no fmt.Print call and initializes Kubernetes logging with logs.InitLogs().
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch only removes CniStateDir from an existing testify helper; it adds no Ginkgo test and no IPv4 literal or external connectivity requirement.
No-Weak-Crypto ✅ Passed The PR adds only iteration over windows.RequiredDirectories; the added code contains no weak-crypto primitive, custom crypto, or secret/token comparison.
Container-Privileges ✅ Passed The PR changes only test/e2e/delete_test.go. It adds no container or Kubernetes manifest privilege settings; the existing manager hostNetwork setting is unchanged.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no logging. It only changes directory iteration and removes CniStateDir from command output, so it introduces no sensitive-data exposure in logs.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the removal of CniStateDir from the delete test assertion.
✨ 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.

@rrasouli

rrasouli commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ranjithrajaram: 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/aws-e2e-ote fcf16d8 link false /test aws-e2e-ote
ci/prow/vsphere-disconnected-e2e-operator fcf16d8 link false /test vsphere-disconnected-e2e-operator
ci/prow/vsphere-proxy-e2e-operator fcf16d8 link true /test vsphere-proxy-e2e-operator

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants