kubevirt / containerized-data-importer

Data Import Service for kubernetes, designed with kubevirt in mind.
Apache License 2.0
395 stars 249 forks source link

[release-v1.57] Add watch for DataImportCron-labeled PVCs deletion #3302

Closed arnongilboa closed 1 month ago

arnongilboa commented 1 month ago

What this PR does / why we need it: Manual backport of #3285

When the DataImportCron last import DV is manually deleted, the controller reconciles, but due to k8s default background cascading deletion, the PVC may still temporarily exist, so the controller will not re-create the DV even after the PVC is deleted, unless it reconciles due to other watched CR like DataSource. In the scenario of CNV-39688, since we move from pvc source format to snapshot, the DataSource won’t update until a snapshot is created, which will never happen. To solve it we add a watch for deletion of DataImportCron-labeled PVCs. The change was tested locally, but since it required two storage classes it’s currently out of scope for the existing CI lanes, so it requires tier-2 test.

Which issue(s) this PR fixes: Fixes # https://issues.redhat.com/browse/CNV-42130

Special notes for your reviewer:

Release note:

BugFix: On deletion of the last import DV of DataImportCron with Snapshot source format, re-create an import DV
akalenyu commented 1 month ago

/approve /lgtm

kubevirt-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akalenyu

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/kubevirt/containerized-data-importer/blob/release-v1.57/OWNERS)~~ [akalenyu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
arnongilboa commented 1 month ago

/retest