Skip to content

Conversation

@skogta
Copy link
Contributor

@skogta skogta commented Dec 17, 2025

What this PR does / why we need it:

As part of this change, we added K8s conditions to batch attach CRD: #3734

However, attached and error fields were left out to ensure that compatibility with VM service is not broken until they make their changes.

This PR removes those fields.

Testing done:

Successfully attached volumes:

apiVersion: cns.vmware.com/v1alpha1
kind: CnsNodeVMBatchAttachment
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"cns.vmware.com/v1alpha1","kind":"CnsNodeVMBatchAttachment","metadata":{"annotations":{},"name":"test-new-1","namespace":"test"},"spec":{"instanceUUID":"7270a6f3-49e8-4923-9211-68c5b8351c0b","volumes":[{"name":"disk-1","persistentVolumeClaim":{"claimName":"pvc-2","controllerKey":1000,"diskMode":"independent_persistent","sharingMode":"sharingNone","unitNumber":1}},{"name":"disk-2","persistentVolumeClaim":{"claimName":"pvc-3","controllerKey":1000,"diskMode":"independent_persistent","sharingMode":"sharingNone","unitNumber":2}}]}}
  creationTimestamp: "2025-12-29T10:42:58Z"
  finalizers:
  - cns.vmware.com
  generation: 4
  name: test-new-1
  namespace: test
  resourceVersion: "1325232"
  uid: 597b1692-77c6-4c28-90cc-f1df671568cd
spec:
  instanceUUID: 7270a6f3-49e8-4923-9211-68c5b8351c0b
  volumes:
  - name: disk-1
    persistentVolumeClaim:
      claimName: pvc-2
      controllerKey: 1000
      diskMode: independent_persistent
      sharingMode: sharingNone
      unitNumber: 1
  - name: disk-2
    persistentVolumeClaim:
      claimName: pvc-3
      controllerKey: 1000
      diskMode: independent_persistent
      sharingMode: sharingNone
      unitNumber: 2
status:
  conditions:
  - lastTransitionTime: "2025-12-30T13:10:37Z"
    message: ""
    reason: "True"
    status: "True"
    type: Ready
  volumes:
  - name: disk-1
    persistentVolumeClaim:
      claimName: pvc-2
      cnsVolumeId: cd03c037-73fd-46ce-bd17-4eea2a8928d7
      conditions:
      - lastTransitionTime: "2025-12-29T10:43:54Z"
        message: ""
        reason: "True"
        status: "True"
        type: VolumeAttached
      diskUUID: 6000C298-47b9-3195-a2eb-3a5b8df3b586
  - name: disk-2
    persistentVolumeClaim:
      claimName: pvc-3
      cnsVolumeId: 72a29bc9-69fd-4286-8cd0-aced44d4a476
      conditions:
      - lastTransitionTime: "2025-12-30T13:10:37Z"
        message: ""
        reason: "True"
        status: "True"
        type: VolumeAttached
      diskUUID: 6000C29c-e0fd-d472-b532-cde77373d0f4

Successfully detached volumes too.

In case of failure in attach, ensured that PVC with error in status got the correct state in pvcsInStatus map:

{"level":"info","time":"2025-12-30T13:13:20.539977069Z","caller":"cnsnodevmbatchattachment/cnsnodevmbatchattachment_helper.go:204","msg":"Test log - PVCs in status map[pvc-2:false pvc-3:true]","TraceId":"41c6212c-7ca8-456c-9265-b70faae34e38"}

In case of failure in detach, ensured that PVC with error in status got the correct state in pvcsInStatus map:

{"level":"info","time":"2025-12-30T13:25:39.726104014Z","caller":"cnsnodevmbatchattachment/cnsnodevmbatchattachment_helper.go:204","msg":"Test log - PVCs in status map[pvc-2:false pvc-3:false]","TraceId":"bcccff36-15eb-4dd4-b916-448c2914b8b9"}

@skogta skogta marked this pull request as draft December 17, 2025 07:59
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 17, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @skogta. Thanks for your PR.

I'm waiting for a github.com 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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 17, 2025
@skogta skogta force-pushed the topic/skogta/removeAttachedAndErrorFields branch from f5b7d3f to f8baeb5 Compare December 30, 2025 13:26
@skogta skogta marked this pull request as ready for review December 30, 2025 13:30
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 30, 2025
@vdkotkar
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 30, 2025
@skogta skogta force-pushed the topic/skogta/removeAttachedAndErrorFields branch from f8baeb5 to dbf4775 Compare January 8, 2026 10:08
@k8s-ci-robot
Copy link
Contributor

@skogta: 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
pull-vsphere-csi-driver-verify-golangci-lint dbf4775 link true /test pull-vsphere-csi-driver-verify-golangci-lint
pull-vsphere-csi-driver-verify-vet dbf4775 link true /test pull-vsphere-csi-driver-verify-vet
pull-vsphere-csi-driver-verify-staticcheck dbf4775 link true /test pull-vsphere-csi-driver-verify-staticcheck

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants