Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Mar 8, 2022
1 parent 466549a commit e177e92
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/builder/controller.go
Expand Up @@ -312,13 +312,16 @@ func (blder *Builder) doController(r reconcile.Reconciler) error {

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

lowerCamelCaseKind := strings.ToLower(gvk.Kind[:1]) + gvk.Kind[1:]

ctrlOptions.LogConstructor = func(req *reconcile.Request) logr.Logger {
log := log
if req != nil {
log = log.WithValues(lowerCamelCaseKind, klog.KRef(req.Namespace, req.Name))
}
Expand Down

0 comments on commit e177e92

Please sign in to comment.