diff --git a/cmd/background-controller/main.go b/cmd/background-controller/main.go index 95b653063b..1eb8dc179f 100644 --- a/cmd/background-controller/main.go +++ b/cmd/background-controller/main.go @@ -309,13 +309,6 @@ func main() { controller.Run(signalCtx, logger.WithName("controllers"), &wg) } // start leader election - for { - select { - case <-signalCtx.Done(): - wg.Wait() - return - default: - le.Run(signalCtx) - } - } + le.Run(signalCtx) + wg.Wait() } diff --git a/cmd/cleanup-controller/main.go b/cmd/cleanup-controller/main.go index 3b44727d67..2d0b13eb3e 100644 --- a/cmd/cleanup-controller/main.go +++ b/cmd/cleanup-controller/main.go @@ -229,13 +229,6 @@ func main() { ) // start server server.Run(ctx.Done()) - // wait for termination signal and run leader election loop - for { - select { - case <-ctx.Done(): - return - default: - le.Run(ctx) - } - } + // start leader election + le.Run(ctx) } diff --git a/cmd/reports-controller/main.go b/cmd/reports-controller/main.go index fed67358e7..0a22197c4c 100644 --- a/cmd/reports-controller/main.go +++ b/cmd/reports-controller/main.go @@ -415,13 +415,6 @@ func main() { for _, controller := range nonLeaderControllers { controller.Run(ctx, logger.WithName("controllers"), &wg) } - for { - select { - case <-ctx.Done(): - wg.Wait() - return - default: - le.Run(ctx) - } - } + le.Run(ctx) + wg.Wait() }