kubernetes-sigs / vsphere-csi-driver

vSphere storage Container Storage Interface (CSI) plugin
https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/index.html
Apache License 2.0
293 stars 177 forks source link

Add CnsUnregisterVolume CRD struct, register controller & add empty controller implementation #2967

Closed gohilankit closed 1 month ago

gohilankit commented 1 month ago

What this PR does / why we need it: This PR is a follow-up to #2959 . It creates struct for CnsUnregisterVolume CRD, registers the corresponding controller & adds an empty implementation for it. It also adds the necessary RBAC changes.
The logic for controller will be added in a subsequent MR.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done: Deployed changes in a Supervisor cluster, and observed that the CNS operator components are getting initialized correctly.

Created a CnsUnregisterVolume instance in namespace playground-ns with below manifest:

apiVersion: cns.vmware.com/v1alpha1
kind: CnsUnregisterVolume
metadata:
  name: unregister-pvc-1
spec:
  pvcName: vanilla-rwo-pvc

Verified from syncer logs that the flow is reaching the Reconcile method in the controller.

{"level":"info","time":"2024-07-23T20:00:24.412425322Z","caller":"cnsunregistervolume/cnsunregistervolume_controller.go:177","msg":"Reconciling CnsUnregisterVolume instance \"unregister-pvc-1\" from namespace \"playground-ns\". timeout \"1s\" seconds"}

The logic to be added in Reconcile method will be added in a subsequent MR.

Release note:

Add CnsUnregisterVolume CRD struct, register controller & add empty controller implementation
adikul30 commented 1 month ago

/ok-to-test

adikul30 commented 1 month ago

Do we need a feature gate for creating this CRD from syncer or ok to create it directly?

gohilankit commented 1 month ago

Do we need a feature gate for creating this CRD from syncer or ok to create it directly?

I will add a feature gate in the next MR pretty soon. Already discussed that with @divyenpatel

adikul30 commented 1 month ago

/approve

deepakkinni commented 1 month ago

/approve /lgtm

k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adikul30, deepakkinni, gohilankit

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/OWNERS)~~ [adikul30,deepakkinni,gohilankit] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
gohilankit commented 1 month ago

Do we need a feature gate for creating this CRD from syncer or ok to create it directly?

I will add a feature gate in the next MR pretty soon. Already discussed that with @divyenpatel

Addressed this in the MR https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2971. PTAL @adikul30