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:
parent
d2658a1bc8
commit
bd64cc4d75
1 changed files with 8 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue