@@ -232,10 +232,11 @@ func (c *Controller) processNextWorkItem(ctx context.Context) bool {
232
232
ctrlmetrics .ActiveWorkers .WithLabelValues (c .Name ).Add (1 )
233
233
defer ctrlmetrics .ActiveWorkers .WithLabelValues (c .Name ).Add (- 1 )
234
234
235
- return c .reconcileHandler (ctx , obj )
235
+ c .reconcileHandler (ctx , obj )
236
+ return true
236
237
}
237
238
238
- func (c * Controller ) reconcileHandler (ctx context.Context , obj interface {}) bool {
239
+ func (c * Controller ) reconcileHandler (ctx context.Context , obj interface {}) {
239
240
// Update metrics after processing each item
240
241
reconcileStartTS := time .Now ()
241
242
defer func () {
@@ -251,7 +252,7 @@ func (c *Controller) reconcileHandler(ctx context.Context, obj interface{}) bool
251
252
c .Queue .Forget (obj )
252
253
c .Log .Error (nil , "Queue item was not a Request" , "type" , fmt .Sprintf ("%T" , obj ), "value" , obj )
253
254
// Return true, don't take a break
254
- return true
255
+ return
255
256
}
256
257
257
258
log := c .Log .WithValues ("name" , req .Name , "namespace" , req .Namespace )
@@ -263,7 +264,7 @@ func (c *Controller) reconcileHandler(ctx context.Context, obj interface{}) bool
263
264
c .Queue .AddRateLimited (req )
264
265
ctrlmetrics .ReconcileErrors .WithLabelValues (c .Name ).Inc ()
265
266
ctrlmetrics .ReconcileTotal .WithLabelValues (c .Name , "error" ).Inc ()
266
- return false
267
+ return
267
268
} else if result .RequeueAfter > 0 {
268
269
// The result.RequeueAfter request will be lost, if it is returned
269
270
// along with a non-nil error. But this is intended as
@@ -272,20 +273,18 @@ func (c *Controller) reconcileHandler(ctx context.Context, obj interface{}) bool
272
273
c .Queue .Forget (obj )
273
274
c .Queue .AddAfter (req , result .RequeueAfter )
274
275
ctrlmetrics .ReconcileTotal .WithLabelValues (c .Name , "requeue_after" ).Inc ()
275
- return true
276
+ return
276
277
} else if result .Requeue {
277
278
c .Queue .AddRateLimited (req )
278
279
ctrlmetrics .ReconcileTotal .WithLabelValues (c .Name , "requeue" ).Inc ()
279
- return true
280
+ return
280
281
}
281
282
282
283
// Finally, if no error occurs we Forget this item so it does not
283
284
// get queued again until another change happens.
284
285
c .Queue .Forget (obj )
285
286
286
287
ctrlmetrics .ReconcileTotal .WithLabelValues (c .Name , "success" ).Inc ()
287
- // Return true, don't take a break
288
- return true
289
288
}
290
289
291
290
// InjectFunc implement SetFields.Injector
0 commit comments