Skip to content

Commit 1a95c59

Browse files
committed
Add comment about the controller change
1 parent d119a35 commit 1a95c59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/ws-manager-mk2/controllers/maintenance_controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ func (r *MaintenanceReconciler) setEnabledUntil(ctx context.Context, enabledUnti
113113
}
114114

115115
func (r *MaintenanceReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error {
116+
// We need to use an unmanaged controller to avoid issues when the pod is in standby mode.
117+
// In that scenario, the controllers are not started and don't watch changes and only
118+
// observe the maintenance mode during the initialization.
116119
c, err := controller.NewUnmanaged("maintenance-controller", mgr, controller.Options{Reconciler: r})
117120
if err != nil {
118121
return err
@@ -127,7 +130,6 @@ func (r *MaintenanceReconciler) SetupWithManager(ctx context.Context, mgr ctrl.M
127130
}()
128131

129132
return c.Watch(source.Kind(mgr.GetCache(), &corev1.ConfigMap{}), &handler.EnqueueRequestForObject{}, &filterConfigMap{})
130-
131133
}
132134

133135
type filterConfigMap struct {

0 commit comments

Comments
 (0)