From 2d89eb60109c81334b57594537573c23162ea897 Mon Sep 17 00:00:00 2001 From: Norman Stetter <85173861+norman-zon@users.noreply.github.com> Date: Mon, 17 Mar 2025 14:34:28 +0100 Subject: [PATCH] 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 <85173861+norman-zon@users.noreply.github.com> --- internal/controller/kustomization_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/controller/kustomization_controller.go b/internal/controller/kustomization_controller.go index b5d52e39..973fd887 100644 --- a/internal/controller/kustomization_controller.go +++ b/internal/controller/kustomization_controller.go @@ -189,6 +189,11 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques // Record Prometheus metrics. r.Metrics.RecordDuration(ctx, obj, reconcileStart) + // Do not proceed if the Kustomization is suspended + if obj.Spec.Suspend { + return + } + // Log and emit success event. if conditions.IsReady(obj) { msg := fmt.Sprintf("Reconciliation finished in %s, next run in %s",