From 432b7b9dcf64c84127762c4cde4d8af4a2e41530 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Tue, 24 Sep 2024 00:47:04 +0300 Subject: [PATCH] Improve logging in delete VR flow Log before import changes to the system in delete VR flow: - deleting the VR resource - updating the PV for removing annotations and retain policy - updating the PVC for removing ramen annotations and finalizers Signed-off-by: Nir Soffer --- internal/controller/vrg_volrep.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/controller/vrg_volrep.go b/internal/controller/vrg_volrep.go index 3692bef87..4e4620b4e 100644 --- a/internal/controller/vrg_volrep.go +++ b/internal/controller/vrg_volrep.go @@ -446,6 +446,7 @@ func (v *VRGInstance) preparePVCForVRDeletion(pvc *corev1.PersistentVolumeClaim, delete(pv.Annotations, pvcVRAnnotationArchivedKey) + log.Info("Deleting ramen annotations from PersistentVolume", "pv", pv.Name) if err := v.reconciler.Update(v.ctx, &pv); err != nil { log.Error(err, "Failed to update PersistentVolume for VR deletion") @@ -462,6 +463,7 @@ func (v *VRGInstance) preparePVCForVRDeletion(pvc *corev1.PersistentVolumeClaim, log1 := log.WithValues("owner removed", ownerRemoved, "finalizer removed", finalizerRemoved) + log1.Info("Deleting ramen annotations and finallizers from PersistentVolumeClaim") if err := v.reconciler.Update(v.ctx, pvc); err != nil { log1.Error(err, "Failed to update PersistentVolumeClaim for VR deletion") @@ -1806,6 +1808,7 @@ func (v *VRGInstance) deleteVR(vrNamespacedName types.NamespacedName, log logr.L }, } + v.log.Info("Deleting VolumeReplication resource %s/%s", vrNamespacedName.Namespace, vrNamespacedName.Name) err := v.reconciler.Delete(v.ctx, cr) if err != nil { if !k8serrors.IsNotFound(err) {