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>
This commit is contained in:
parent
dc0e5853c0
commit
2d89eb6010
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue