diff --git a/pkg/instancegroups/controller.go b/pkg/instancegroups/controller.go index 2ddb4c909b..13c79826a9 100644 --- a/pkg/instancegroups/controller.go +++ b/pkg/instancegroups/controller.go @@ -107,7 +107,9 @@ func (c *Controller) Shutdown() { func (c *Controller) sync(key string) error { start := time.Now() klog.V(4).Infof("Instance groups controller: Start processing %s", key) - defer klog.V(4).Infof("Instance groups controller: Processing key %s took %v", key, time.Since(start)) + defer func() { + klog.V(4).Infof("Instance groups controller: Processing key %s took %v", key, time.Since(start)) + }() nodeNames, err := utils.GetReadyNodeNames(listers.NewNodeLister(c.lister)) if err != nil {