Skip to content

Commit ad78e4e

Browse files
committed
feat: prevent no-op reconciles
There are edge cases where a reonciliation can be triggered on a suspended Kustomization, mainly through changes in a source. In these cases a "no-op" reconciliation occurs, which can be confusing for the user. This returns early if the Kustomization ist suspended. Signed-off-by: Norman Stetter <[email protected]>
1 parent 250e8fc commit ad78e4e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/controller/kustomization_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
181181

182182
// Finalise the reconciliation and report the results.
183183
defer func() {
184+
// Do not proceed if the Kustomization is suspended
185+
if obj.Spec.Suspend {
186+
return
187+
}
188+
184189
// Patch finalizers, status and conditions.
185190
if err := r.finalizeStatus(ctx, obj, patcher); err != nil {
186191
retErr = kerrors.NewAggregate([]error{retErr, err})

0 commit comments

Comments
 (0)