From 8ad5c0d84e57e8b802abfd418f5f66ffa59f54d7 Mon Sep 17 00:00:00 2001 From: Andreas Fritzler Date: Fri, 26 Apr 2024 13:39:46 +0200 Subject: [PATCH] Fix registry start in manager (#23) --- cmd/manager/main.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 09ac76c..75edc4b 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -233,16 +233,19 @@ func main() { } ctx := ctrl.SetupSignalHandler() - setupLog.Info("starting manager") - if err := mgr.Start(ctx); err != nil { - setupLog.Error(err, "problem running manager") - os.Exit(1) - } setupLog.Info("starting registry server", "RegistryURL", registryURL) registryServer := registry.NewServer(registryAddr) - if err := registryServer.Start(ctx); err != nil { - setupLog.Error(err, "problem running registry server") + go func() { + if err := registryServer.Start(ctx); err != nil { + setupLog.Error(err, "problem running registry server") + os.Exit(1) + } + }() + + setupLog.Info("starting manager") + if err := mgr.Start(ctx); err != nil { + setupLog.Error(err, "problem running manager") os.Exit(1) } }