Skip to content

Update CnsRegisterApi for to include volumeMode #3286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skogta
Copy link
Contributor

@skogta skogta commented May 21, 2025

What this PR does / why we need it:
Update CnsRegisterVolume API to include volumeMode.
This is required for static volume provisioning for RWX block volumes.

Testing done:
Example of CnsRegisterVolume:

apiVersion: cns.vmware.com/v1alpha1
kind: CnsRegisterVolume
metadata:
  name: test1
  namespace: test
spec:
  pvcName: rwx-block
  volumeID: 658edb43-edb6-48c6-b6cc-673fbc5e655b
  accessMode: ReadWriteMany
  volumemode: Block
  1. Create RWX block volume
  2. Create RWO block volume
  3. Create RWO filesystem volume
  4. RWO without volumemode
  5. RWX without volumemode
  6. VolumeID without accessmode
    Failed as expected:
{"level":"error","time":"2025-06-11T14:01:20.2269059Z","caller":"cnsregistervolume/cnsregistervolume_controller.go:242","msg":"AccessMode cannot be empty when volumeID is specified","stacktrace":"sigs.k8s.io/vsphere-csi-driver/v3/pkg/syncer/cnsoperator/controller/cnsregistervolume.(*ReconcileCnsRegisterVolume).Reconcile\n\t/build/pkg/syncer/cnsoperator/controller/cnsregistervolume/cnsregistervolume_controller.go:242\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:116\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:303\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:263\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:224"}

All PVCs/PVs got created as expected.

root@421aef3e18ebde982837cd87cb0e8d7e [ ~ ]# k get pvc -n test -w
NAME               STATUS   VOLUME                                           CAPACITY   ACCESS MODES   STORAGECLASS                  VOLUMEATTRIBUTESCLASS   AGE
rwo-block-1        Bound    static-pv-cb97e2b1-5c3e-4573-8bc0-699ff3861de5   64Mi       RWO            vsan-default-storage-policy   <unset>                 33m
rwo-fs             Bound    static-pv-4e4c0cd5-082e-458f-8eec-c3f8ee53d805   64Mi       RWO            vsan-default-storage-policy   <unset>                 31m
rwo-novolumemode   Bound    static-pv-b8ef49a9-fc83-4e72-97b6-c29bd15bcbff   64Mi       RWO            vsan-default-storage-policy   <unset>                 29m
rwx-block-1        Bound    static-pv-3f594f2d-fd02-4a01-995f-93577910434e   64Mi       RWX            vsan-default-storage-policy   <unset>                 36m
rwx-withoutvolumemode   Bound    static-pv-658edb43-edb6-48c6-b6cc-673fbc5e655b   64Mi       RWX            vsan-default-storage-policy   <unset>                 2m45s

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 21, 2025
@skogta skogta marked this pull request as draft May 21, 2025 06:05
@k8s-ci-robot k8s-ci-robot added 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 May 21, 2025
@k8s-ci-robot k8s-ci-robot requested review from gnufied and shalini-b May 21, 2025 06:05
@k8s-ci-robot
Copy link
Contributor

Hi @skogta. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

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
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 shalini-b for approval. For more information see the Code Review Process.

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

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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 21, 2025
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from b09e7a1 to 948c0f8 Compare May 21, 2025 09:28
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 948c0f8 to 26b3ffd Compare May 29, 2025 04:16
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch 4 times, most recently from 0243060 to 1cff94f Compare June 11, 2025 09:28
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2025
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 1cff94f to 937cb29 Compare June 11, 2025 09:34
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 11, 2025
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 937cb29 to 9302ace Compare June 11, 2025 14:24
@skogta skogta changed the title UpdateCnsRegisterApi for to include volumeMode and FsType Update CnsRegisterApi for to include volumeMode Jun 12, 2025
@skogta skogta marked this pull request as ready for review June 12, 2025 09:41
@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 Jun 12, 2025
@skogta skogta marked this pull request as draft June 12, 2025 13:25
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 12, 2025
@skogta skogta marked this pull request as ready for review June 12, 2025 13:49
@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 Jun 12, 2025
@k8s-ci-robot k8s-ci-robot requested a review from xing-yang June 12, 2025 13:49
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 9302ace to 7f9e275 Compare June 12, 2025 13:50
@divyenpatel
Copy link
Member

/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 Jun 13, 2025
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 7f9e275 to 944ca1a Compare June 13, 2025 05:03
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2025
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 944ca1a to 97bf453 Compare June 13, 2025 07:26
@skogta
Copy link
Contributor Author

skogta commented Jun 13, 2025

/retest-required

@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 97bf453 to 434d217 Compare July 8, 2025 08:01
@skogta skogta force-pushed the topic/skogta/cnsRegisterVolumeUpdate branch from 434d217 to aab9f31 Compare July 8, 2025 08:06
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