diff --git a/pkg/utils/controller/run.go b/pkg/utils/controller/run.go index a0e66076e7..133a68bd65 100644 --- a/pkg/utils/controller/run.go +++ b/pkg/utils/controller/run.go @@ -150,6 +150,8 @@ func reconcile(ctx context.Context, logger logr.Logger, obj interface{}, r recon } logger = logger.WithValues("key", k, "namespace", ns, "name", n) logger.Info("reconciling ...") - defer logger.Info("done", "duration", time.Since(start).String()) + defer func(start time.Time) { + logger.Info("done", "duration", time.Since(start).String()) + }(start) return r(ctx, logger, k, ns, n) }