Skip to content

Commit

Permalink
fix: deleting lvmcluster successfully in case of wrong disk path in CR
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
riya-singhal31 committed Sep 29, 2022
1 parent 282bcbc commit ac5a1ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/vgmanager/vgmanager_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac5a1ec

Please sign in to comment.