Skip to content

Commit

Permalink
fix: fix ensureCreated of lvmVG via returning an error
Browse files Browse the repository at this point in the history
The func does not return an error if there is an error and always return
nil. Fix the same via returning and error if there is a failure.

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
  • Loading branch information
iamniting committed Apr 1, 2022
1 parent a3e857a commit 968da6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/lvm_volumegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ func (c lvmVG) ensureCreated(r *LVMClusterReconciler, ctx context.Context, lvmCl
return nil
})

if err != nil {
if err != nil && !errors.IsAlreadyExists(err) {
r.Log.Error(err, "failed to reconcile LVMVolumeGroup", "name", volumeGroup.Name)
return err
} else {
r.Log.Info("LVMVolumeGroup", "operation", result, "name", volumeGroup.Name)
}
Expand Down

0 comments on commit 968da6a

Please sign in to comment.