1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-28 10:28:36 +00:00

refact: disable leader for update request controller (#3807)

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
This commit is contained in:
Prateek Pandey 2022-05-05 19:49:19 +05:30 committed by GitHub
parent d480f9f8f4
commit 2af9046e13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -429,7 +429,6 @@ func main() {
go certManager.Run(stopCh)
go policyCtrl.Run(2, prgen.ReconcileCh, stopCh)
go prgen.Run(1, stopCh)
go urc.Run(genWorkers, stopCh)
go grcc.Run(1, stopCh)
}
@ -460,6 +459,7 @@ func main() {
// init events handlers
// start Kyverno controllers
go urc.Run(genWorkers, stopCh)
go le.Run(ctx)
go reportReqGen.Run(2, stopCh)
go configurationController.Run(stopCh)

View file

@ -109,9 +109,12 @@ func NewController(
// Run starts workers
func (c *Controller) Run(workers int, stopCh <-chan struct{}) {
logger := c.log
defer utilruntime.HandleCrash()
defer c.queue.ShutDown()
defer c.log.Info("shutting down")
logger.Info("starting")
defer logger.Info("shutting down")
c.policyInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
UpdateFunc: c.updatePolicy, // We only handle updates to policy