Skip to content

Commit

Permalink
Simplified error statement in the Reconcile loop.
Browse files Browse the repository at this point in the history
Small nit to make if statement easier to read.

Signed-off-by: Michal Pryc <[email protected]>
  • Loading branch information
mpryc committed Apr 29, 2024
1 parent 476783c commit c91e31a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/controller/nonadminbackup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ func (r *NonAdminBackupReconciler) Reconcile(ctx context.Context, req ctrl.Reque

// Bail out when the Non Admin Backup reconcile was triggered, when the NAB got deleted
// Reconcile loop was triggered when Velero Backup object got updated and NAB isn't there
if err != nil && apierrors.IsNotFound(err) {
logger.V(1).Info("Non existing NonAdminBackup CR", nameField, req.Name, constant.NameSpaceString, req.Namespace)
return ctrl.Result{}, nil
}

if err != nil {
if apierrors.IsNotFound(err) {
logger.V(1).Info("Non existing NonAdminBackup CR", nameField, req.Name, constant.NameSpaceString, req.Namespace)
return ctrl.Result{}, nil
}
logger.Error(err, "Unable to fetch NonAdminBackup CR", nameField, req.Name, constant.NameSpaceString, req.Namespace)
return ctrl.Result{}, err
}
Expand Down

0 comments on commit c91e31a

Please sign in to comment.