Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,11 +907,17 @@ func main() {
}
}

signalCtx := ctrl.SetupSignalHandler()

errchan := make(chan error)
go func() {
if !mgr.GetCache().WaitForCacheSync(signalCtx) {
setupLog.Error(nil, "cache sync failed, exiting before starting api server")
os.Exit(1)
}
errchan <- func() error {
setupLog.Info("starting api server", "address", ":8080")
return httpext.ListenAndServeContext(ctx, ":8080", mux)
return httpext.ListenAndServeContext(signalCtx, ":8080", mux)
}()
}()
go func() {
Expand All @@ -922,7 +928,7 @@ func main() {
}()

setupLog.Info("starting manager")
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
if err := mgr.Start(signalCtx); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)
}
Expand Down