Skip to content

Commit

Permalink
add handleError function to other places in ssp reconcile function
Browse files Browse the repository at this point in the history
some of our tests are sometimes failing due to error
Operation cannot be fulfilled on ssps.ssp.kubevirt.io
\"ssp-kubevirt-hyperconverged\": the object has been modified.
handleError function should resolve if the error is real error, or just
"conflict" error.

Signed-off-by: Karel Šimon <ksimon@redhat.com>
  • Loading branch information
ksimon1 committed May 25, 2022
1 parent 1b07ce5 commit fb34617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/ssp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (r *sspReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ct

if updated, err := updateSsp(sspRequest); updated || (err != nil) {
// SSP was updated, and the update will trigger reconciliation again.
return ctrl.Result{}, err
return handleError(sspRequest, err, sspRequest.Logger)
}

if isBeingDeleted(sspRequest.Instance) {
Expand Down Expand Up @@ -205,7 +205,7 @@ func (r *sspReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ct
sspRequest.Logger.V(1).Info("Updating CR status post reconciliation...")
err = updateStatus(sspRequest, reconcileResults)
if err != nil {
return ctrl.Result{}, err
return handleError(sspRequest, err, sspRequest.Logger)
}
sspRequest.Logger.Info("CR status updated")

Expand Down

0 comments on commit fb34617

Please sign in to comment.