diff --git a/cmd/controller/cmd/webhook.go b/cmd/controller/cmd/webhook.go index d22da0f28..87e19448d 100644 --- a/cmd/controller/cmd/webhook.go +++ b/cmd/controller/cmd/webhook.go @@ -130,6 +130,14 @@ func runWebhook(origContext context.Context, propellerCfg *config.Config, cfg *w return err }) + g.Go(func() error { + err := controller.StartControllerManager(childCtx, mgr) + if err != nil { + logger.Fatalf(childCtx, "Failed to start controller manager. Error: %v", err) + } + return err + }) + g.Go(func() error { err := webhook.Run(childCtx, propellerCfg, cfg, defaultNamespace, &webhookScope, mgr) if err != nil { diff --git a/pkg/webhook/entrypoint.go b/pkg/webhook/entrypoint.go index 4f5a06825..50c4099c2 100644 --- a/pkg/webhook/entrypoint.go +++ b/pkg/webhook/entrypoint.go @@ -52,8 +52,10 @@ func Run(ctx context.Context, propellerCfg *config.Config, cfg *config2.Config, logger.Fatalf(ctx, "Failed to register webhook with manager. Error: %v", err) } - logger.Infof(ctx, "Starting controller-runtime manager") - return (*mgr).Start(ctx) + logger.Infof(ctx, "Started propeller webhook") + <-ctx.Done() + + return nil } func createMutationConfig(ctx context.Context, kubeClient *kubernetes.Clientset, webhookObj *PodMutator, defaultNamespace string) error {