Skip to content

Commit

Permalink
Set runtime logger for gardenlet
Browse files Browse the repository at this point in the history
This was forgotten in gardener#5057 and prevents logs for packages used in gardenlet which were already migrated from `logrus` to `logr`.
  • Loading branch information
rfranzke committed Mar 12, 2022
1 parent c3d936b commit edc2793
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/gardenlet/app/gardenlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import (
"k8s.io/client-go/tools/record"
"k8s.io/component-base/version"
"k8s.io/component-base/version/verflag"
runtimelog "sigs.k8s.io/controller-runtime/pkg/log"
)

// Options has all the context and parameters needed to run a Gardenlet.
Expand Down Expand Up @@ -244,6 +245,9 @@ func NewGardenlet(ctx context.Context, cfg *config.GardenletConfiguration) (*Gar
return nil, fmt.Errorf("error instantiating zap logger: %w", err)
}

// set the logger used by sigs.k8s.io/controller-runtime
runtimelog.SetLogger(log)

log.Info("Starting gardenlet", "version", version.Get())
log.Info("Feature Gates", "featureGates", gardenletfeatures.FeatureGate.String())

Expand Down

0 comments on commit edc2793

Please sign in to comment.