@@ -204,27 +204,27 @@ func (c *Controller) processNextWorkItem(ctx context.Context) bool {
204
204
}
205
205
206
206
// We wrap this block in a func so we can defer c.workqueue.Done.
207
- err := func (key string ) error {
207
+ err := func () error {
208
208
// We call Done here so the workqueue knows we have finished
209
209
// processing this item. We also must remember to call Forget if we
210
210
// do not want this work item being re-queued. For example, we do
211
211
// not call Forget if a transient error occurs, instead the item is
212
212
// put back on the workqueue and attempted again after a back-off
213
213
// period.
214
- defer c .workqueue .Done (key )
214
+ defer c .workqueue .Done (obj )
215
215
// Run the syncHandler, passing it the namespace/name string of the
216
216
// Foo resource to be synced.
217
- if err := c .syncHandler (ctx , key ); err != nil {
217
+ if err := c .syncHandler (ctx , obj ); err != nil {
218
218
// Put the item back on the workqueue to handle any transient errors.
219
- c .workqueue .AddRateLimited (key )
220
- return fmt .Errorf ("error syncing '%s': %s, requeuing" , key , err .Error ())
219
+ c .workqueue .AddRateLimited (obj )
220
+ return fmt .Errorf ("error syncing '%s': %s, requeuing" , obj , err .Error ())
221
221
}
222
222
// Finally, if no error occurs we Forget this item so it does not
223
223
// get queued again until another change happens.
224
224
c .workqueue .Forget (obj )
225
- logger .Info ("Successfully synced" , "resourceName" , key )
225
+ logger .Info ("Successfully synced" , "resourceName" , obj )
226
226
return nil
227
- }(obj )
227
+ }()
228
228
229
229
if err != nil {
230
230
utilruntime .HandleError (err )
0 commit comments