Skip to content

Commit

Permalink
🐛 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 committed May 18, 2022
1 parent 7fb8534 commit a1f1aad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/builder/controller.go
Original file line number Diff line number Diff line change
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 a1f1aad

Please sign in to comment.