@@ -105,14 +105,14 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt
105
105
handler .EnqueueRequestsFromMapFunc (r .MachineToMachineSets ),
106
106
).
107
107
WithOptions (options ).
108
- WithEventFilter (predicates .ResourceNotPausedAndHasFilterLabel (ctrl .LoggerFrom (ctx ), r .WatchFilterValue )).
108
+ WithEventFilter (predicates .ResourceHasFilterLabel (ctrl .LoggerFrom (ctx ), r .WatchFilterValue )).
109
109
Watches (
110
110
& clusterv1.Cluster {},
111
111
handler .EnqueueRequestsFromMapFunc (clusterToMachineSets ),
112
112
builder .WithPredicates (
113
113
// TODO: should this wait for Cluster.Status.InfrastructureReady similar to Infra Machine resources?
114
114
predicates .All (ctrl .LoggerFrom (ctx ),
115
- predicates .ClusterUnpaused (ctrl .LoggerFrom (ctx )),
115
+ predicates .ClusterCreateUpdateEvent (ctrl .LoggerFrom (ctx )),
116
116
predicates .ResourceHasFilterLabel (ctrl .LoggerFrom (ctx ), r .WatchFilterValue ),
117
117
),
118
118
),
@@ -153,12 +153,6 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Re
153
153
return ctrl.Result {}, err
154
154
}
155
155
156
- // Return early if the object or Cluster is paused.
157
- if annotations .IsPaused (cluster , machineSet ) {
158
- log .Info ("Reconciliation is paused for this object" )
159
- return ctrl.Result {}, nil
160
- }
161
-
162
156
// Initialize the patch helper
163
157
patchHelper , err := patch .NewHelper (machineSet , r .Client )
164
158
if err != nil {
@@ -172,6 +166,14 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Re
172
166
}
173
167
}()
174
168
169
+ // Return early if the object or Cluster is paused.
170
+ if annotations .IsPaused (cluster , machineSet ) {
171
+ log .Info ("Reconciliation is paused for this object" )
172
+ conditions .MarkTrue (machineSet , clusterv1 .PausedCondition )
173
+ return ctrl.Result {}, nil
174
+ }
175
+ conditions .MarkFalse (machineSet , clusterv1 .PausedCondition , clusterv1 .ResourceNotPausedReason , clusterv1 .ConditionSeverityInfo , "Resource is operating as expected" )
176
+
175
177
// Ignore deleted MachineSets, this can happen when foregroundDeletion
176
178
// is enabled
177
179
if ! machineSet .DeletionTimestamp .IsZero () {
0 commit comments