Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions controllers/volumereplication_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,12 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re

return reconcile.Result{}, err
}
if err = r.addFinalizerToPVC(logger, pvc); err != nil {
logger.Error(err, "Failed to add PersistentVolumeClaim finalizer")
if pvc.GetDeletionTimestamp().IsZero() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the PVC is getting deleted should we just return error at https://github.com/csi-addons/kubernetes-csi-addons/blob/main/controllers/replication.storage/volumereplication_controller.go#L200 and let the next reconcile fail?

if err = r.addFinalizerToPVC(logger, pvc); err != nil {
logger.Error(err, "Failed to add PersistentVolumeClaim finalizer")

return reconcile.Result{}, err
return reconcile.Result{}, err
}
}
} else {
if contains(instance.GetFinalizers(), volumeReplicationFinalizer) {
Expand Down