Skip to content

Commit 2d89eb6

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 <85173861+norman-zon@users.noreply.github.com>
1 parent dc0e585 commit 2d89eb6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

internal/controller/kustomization_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
189189
// Record Prometheus metrics.
190190
r.Metrics.RecordDuration(ctx, obj, reconcileStart)
191191

192+
// Do not proceed if the Kustomization is suspended
193+
if obj.Spec.Suspend {
194+
return
195+
}
196+
192197
// Log and emit success event.
193198
if conditions.IsReady(obj) {
194199
msg := fmt.Sprintf("Reconciliation finished in %s, next run in %s",

0 commit comments

Comments
 (0)