1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00

feat: run leader election in loop (#5173)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-11-01 10:28:20 +00:00 committed by GitHub
parent d2658a1bc8
commit bd64cc4d75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -723,7 +723,14 @@ func main() {
controller.run(signalCtx, logger.WithName("controllers"), &wg)
}
// start leader election
go le.Run(signalCtx)
go func() {
select {
case <-signalCtx.Done():
return
default:
le.Run(signalCtx)
}
}()
// create webhooks server
urgen := webhookgenerate.NewGenerator(
kyvernoClient,