Skip to content

Commit

Permalink
bug: don't override global log in builder
Browse files Browse the repository at this point in the history
The recent change
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.
  • Loading branch information
adracus authored and k8s-infra-cherrypick-robot committed May 19, 2022
1 parent 3966c67 commit 19f8d99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/builder/controller.go
Expand Up @@ -309,7 +309,7 @@ func (blder *Builder) doController(r reconcile.Reconciler) error {

// Setup the logger.
if ctrlOptions.LogConstructor == nil {
log = blder.mgr.GetLogger().WithValues(
log := blder.mgr.GetLogger().WithValues(
"controller", controllerName,
"controllerGroup", gvk.Group,
"controllerKind", gvk.Kind,
Expand Down

0 comments on commit 19f8d99

Please sign in to comment.