-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add watch for DataImportCron-labeled PVCs deletion #3285
Add watch for DataImportCron-labeled PVCs deletion #3285
Conversation
@@ -1077,6 +1077,17 @@ func addDataImportCronControllerWatches(mgr manager.Manager, c controller.Contro | |||
return err | |||
} | |||
|
|||
if err := c.Watch(source.Kind(mgr.GetCache(), &corev1.PersistentVolumeClaim{}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to place this above the snapshot watch, since it has a
containerized-data-importer/pkg/controller/dataimportcron-controller.go
Lines 1062 to 1063 in 4e7e683
// Back out if there's no point to attempt watch | |
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed.
/approve |
[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:
Approvers can indicate their approval by writing |
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. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
4e7e683
to
42135a7
Compare
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/cherrypick release-v1.59 |
@arnongilboa: new pull request created: #3300 In response to this:
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. |
/cherrypick release-v1.58 |
@arnongilboa: #3285 failed to apply on top of branch "release-v1.58":
In response to this:
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. |
Manual backport of kubevirt#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. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
Manual backport of kubevirt#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. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
…3301) 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. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
…3302) 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. Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
What this PR does / why we need it:
When the
DataImportCron
last importDV
is manually deleted, the controller reconciles, but due to k8s default background cascading deletion, thePVC
may still temporarily exist, so the controller will not re-create theDV
even after thePVC
is deleted, unless it reconciles due to other watched CR likeDataSource
. In the scenario of CNV-39688, since we move fromPVC
source format to snapshot, theDataSource
won’t update until a snapshot is created, which will never happen. To solve it we add a watch for deletion of DataImportCron-labeledPVCs
. 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-39688
Special notes for your reviewer:
Release note: