vmware-tanzu / velero-plugin-for-vsphere

Plugin to support Velero on vSphere
Other
59 stars 49 forks source link

Remove health annotation from PVC #498

Closed xing-yang closed 1 year ago

xing-yang commented 1 year ago

Remove health annotation from PVC before handing it over to Velero to create the PVC during the restore.

What this PR does / why we need it: In the case when Velero vSphere Plugin does not handle the restore of the PVC, it hands it over to Velero to create the PVC. This could happen in the following cases: (1) velero backup create test-backup --include-namespaces test-ns --snapshot-volumes=true velero restore create test-restore --from-backup test-backup --restore-volumes=false (2) velero backup create test-backup --include-namespaces test-ns --snapshot-volumes=false velero restore create test-restore --from-backup test-backup --restore-volumes=true

If the PVC has the health annotation, however, vSphere CSI Driver's webhook on WCP will reject the PVC creation request. So the fix is to remove the annotation before returning it back to Velero.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Removes health annotation from PVC before handing it over to Velero during the restore.
svcbot-qecnsdp commented 1 year ago

Sorry, some of the pre-check tests are failing for this PR !

Please check the Jenkins job for more details https://container-dp.svc.eng.vmware.com/job/CNSDP-CI/767/