1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

refact: remove unused Run function from generate (#3638)

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

View file

@ -524,7 +524,6 @@ func main() {
go reportReqGen.Run(2, stopCh) go reportReqGen.Run(2, stopCh)
go configData.Run(stopCh) go configData.Run(stopCh)
go eventGenerator.Run(3, stopCh) go eventGenerator.Run(3, stopCh)
go grgen.Run(10, stopCh)
go pCacheController.Run(1, stopCh) go pCacheController.Run(1, stopCh)
go auditHandler.Run(10, stopCh) go auditHandler.Run(10, stopCh)
if !debug { if !debug {

View file

@ -15,7 +15,6 @@ import (
admissionv1 "k8s.io/api/admission/v1" admissionv1 "k8s.io/api/admission/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
) )
@ -67,24 +66,6 @@ func (g *Generator) Apply(gr kyverno.GenerateRequestSpec, action admissionv1.Ope
return nil return nil
} }
// Run starts the generate request spec
func (g *Generator) Run(workers int, stopCh <-chan struct{}) {
logger := g.log
defer utilruntime.HandleCrash()
logger.V(4).Info("starting")
defer func() {
logger.V(4).Info("shutting down")
}()
if !cache.WaitForCacheSync(stopCh, g.grSynced) {
logger.Info("failed to sync informer cache")
return
}
<-g.stopCh
}
func (g *Generator) processApply(m GeneratorChannel) { func (g *Generator) processApply(m GeneratorChannel) {
if err := g.generate(m.spec, m.action); err != nil { if err := g.generate(m.spec, m.action); err != nil {
logger.Error(err, "failed to generate request CR") logger.Error(err, "failed to generate request CR")