fixed e2e test
@@ -206,7 +206,8 @@ func NewPolicyController(kyvernoClient *kyvernoclient.Clientset,
// rebuild after 300 seconds/ 5 mins
//TODO: pass the time in seconds instead of converting it internally
pc.rm = NewResourceManager(30)
- go func() {
+ if os.Getenv("POLICY-TYPE") == "POLICYREPORT" {
+ go func(pc PolicyController) {
for k := range time.Tick(60 * time.Second) {
pc.log.V(2).Info("Policy Background sync at", "time", k.String())
if len(pc.policySync.policy) > 0 {
@@ -216,7 +217,8 @@ func NewPolicyController(kyvernoClient *kyvernoclient.Clientset,
})
}
}
- }()
+ }(pc)
+ }
return &pc, nil
}
