From 87834d0958a3e249abf8c9eb6b5f04fe0e8bcc23 Mon Sep 17 00:00:00 2001 From: Michael Shitrit Date: Tue, 30 Jan 2024 16:59:59 +0200 Subject: [PATCH] fixing error code missing because of wrong error conversion Signed-off-by: Michael Shitrit --- controllers/selfnoderemediationconfig_controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/selfnoderemediationconfig_controller.go b/controllers/selfnoderemediationconfig_controller.go index 159aef00..888d0e47 100644 --- a/controllers/selfnoderemediationconfig_controller.go +++ b/controllers/selfnoderemediationconfig_controller.go @@ -93,6 +93,9 @@ func (r *SelfNodeRemediationConfigReconciler) Reconcile(ctx context.Context, req } if err := r.syncConfigDaemonSet(ctx, config); err != nil { + if errors.IsConflict(err) { + return ctrl.Result{RequeueAfter: time.Second}, nil + } logger.Error(err, "error syncing DS") return ctrl.Result{}, err } @@ -180,7 +183,7 @@ func (r *SelfNodeRemediationConfigReconciler) syncK8sResource(ctx context.Contex } if err := apply.ApplyObject(ctx, r.Client, in); err != nil { - return fmt.Errorf("failed to apply object %v with err: %v", in, err) + return pkgerrors.Wrapf(err, "failed to apply object %v", in) } return nil }