Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 79a1a88

Browse files
committed
fix(controller): prevent conditions and spread reconciles in read-only mode
1 parent a654124 commit 79a1a88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controller/lifecycle/lifecycle.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ func (l *LifecycleManager) SetupWithManagerBuilder(mgr ctrl.Manager, maxReconcil
423423
return nil, err
424424
}
425425

426+
if (l.manageConditions || l.spreadReconciles) && l.readOnly {
427+
return nil, fmt.Errorf("cannot use conditions or spread reconciles in read-only mode")
428+
}
429+
426430
eventPredicates = append([]predicate.Predicate{filter.DebugResourcesBehaviourPredicate(debugLabelValue)}, eventPredicates...)
427431
return ctrl.NewControllerManagedBy(mgr).
428432
Named(reconcilerName).

0 commit comments

Comments
 (0)