Skip to content

Commit

Permalink
Ensure logging injection is first
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed May 18, 2024
1 parent 9329975 commit ca6203b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/webhooks/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ func NewConfigValidationWebhook(ctx context.Context, _ configmap.Watcher) *contr
// Start copies the relevant portions for starting the webhooks from sharedmain.MainWithConfig
// https://github.com/knative/pkg/blob/0f52db700d63/injection/sharedmain/main.go#L227
func Start(ctx context.Context, cfg *rest.Config, ctors ...knativeinjection.ControllerConstructor) {
ctx, startInformers := knativeinjection.EnableInjectionOrDie(ctx, cfg)
logger := logging.NewLogger(ctx, component).Sugar()
ctx = knativelogging.WithLogger(ctx, logger)

ctx, startInformers := knativeinjection.EnableInjectionOrDie(ctx, cfg)
cmw := sharedmain.SetupConfigMapWatchOrDie(ctx, logger)
controllers, webhooks := sharedmain.ControllersAndWebhooksFromCtors(ctx, cmw, ctors...)

Expand Down

0 comments on commit ca6203b

Please sign in to comment.