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
289 stars 173 forks source link

retry stroage policy usage CR creation #2889

Closed divyenpatel closed 2 months ago

divyenpatel commented 2 months ago

What this PR does / why we need it: If policy usage CR creation fails, CSI Driver does not retry creating usage CR.

When user creates PVC on the namespace, we volume can not be created since policy usage CR is missing even when quota is assigned for the policy on the namespace. Only option for user is to restart the CSI Driver syncer container or re-assign policy on the namespace.

This PR is adding re-try mechanism to retry creating this critical CR for 5 minutes. After 5 minutes driver will be crashed if storage policy usage CR is not created , and stroagepolicyquota add event will be replayed and will again attempt to create storagepolicyusage CR.

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: In progress

Special notes for your reviewer:

Release note:

retry stroage policy usage CR creation
k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel

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)~~ [divyenpatel] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
divyenpatel commented 2 months ago

closing this PR. as I see proper code fix is there in https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/2888