Skip to content

Commit

Permalink
Avoid duplicated irreconcilable status
Browse files Browse the repository at this point in the history
  • Loading branch information
kovayur committed Jul 31, 2023
1 parent a775742 commit 6a51ffc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.
)
return ctrl.Result{}, err
}
u.UpdateStatus(updater.EnsureCondition(conditions.Irreconcilable(corev1.ConditionFalse, "", "")))

for _, h := range r.preHooks {
if err := h.Exec(obj, vals, log); err != nil {
Expand All @@ -651,7 +650,9 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.
return ctrl.Result{}, err
}
default:
return ctrl.Result{}, fmt.Errorf("unexpected release state: %s", state)
err := fmt.Errorf("unexpected release state: %s", state)
u.UpdateStatus(updater.EnsureCondition(conditions.Irreconcilable(corev1.ConditionTrue, conditions.ReasonReconcileError, err)))
return ctrl.Result{}, err
}

for _, h := range r.postHooks {
Expand Down

0 comments on commit 6a51ffc

Please sign in to comment.