From ac5a1ec34cfb0b61e85ac38c88a4c76ede706551 Mon Sep 17 00:00:00 2001 From: riya-singhal31 Date: Thu, 29 Sep 2022 12:30:01 +0530 Subject: [PATCH] fix: deleting lvmcluster successfully in case of wrong disk path in CR lvmcluster was failing to delete in case of wrong disk path provided in spec. Updated the code to update the status of lvmvolumegroupnodestatus in case when there is no lvmd file exists like in case when the user gives wrong disk path in lvmclusterCR, because lvmclusterCR reads the information from lvmvolumegroupnodestatus. Signed-off-by: riya-singhal31 --- pkg/vgmanager/vgmanager_controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/vgmanager/vgmanager_controller.go b/pkg/vgmanager/vgmanager_controller.go index 4701b1793..935acb914 100644 --- a/pkg/vgmanager/vgmanager_controller.go +++ b/pkg/vgmanager/vgmanager_controller.go @@ -324,6 +324,10 @@ func (r *VGReconciler) processDelete(ctx context.Context, volumeGroup *lvmv1alph } if lvmdConfig == nil { r.Log.Info("lvmd config file does not exist") + if statuserr := r.updateStatus(ctx, nil); statuserr != nil { + r.Log.Error(statuserr, "failed to update status", "VGName", volumeGroup.Name) + return statuserr + } return nil } // To avoid having to iterate through device classes multiple times, map from name to config index