Skip to content

Commit 19f8d99

Browse files
adracusk8s-infra-cherrypick-robot
authored andcommitted
bug: don't override global log in builder
The recent change kubernetes-sigs@598978c#diff-e77b9468ab935d5ea4d5cdae3b994114bada17df0001570e4b1436419afd50ccR312 introduced a bug by overriding `log` with the log created by a builder, resulting in all logs produced by `controller-runtime` having `controller`, `controllerGroup` and `controllerKind` set to the last created controller.
1 parent 3966c67 commit 19f8d99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/builder/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func (blder *Builder) doController(r reconcile.Reconciler) error {
309309

310310
// Setup the logger.
311311
if ctrlOptions.LogConstructor == nil {
312-
log = blder.mgr.GetLogger().WithValues(
312+
log := blder.mgr.GetLogger().WithValues(
313313
"controller", controllerName,
314314
"controllerGroup", gvk.Group,
315315
"controllerKind", gvk.Kind,

0 commit comments

Comments
 (0)