mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
build failed fix
This commit is contained in:
parent
6a0a5132b5
commit
94a549bdb7
1 changed files with 6 additions and 7 deletions
|
@ -438,12 +438,6 @@ func (pc *PolicyController) syncPolicy(key string) error {
|
|||
}
|
||||
|
||||
if errors.IsNotFound(err) {
|
||||
if os.Getenv("POLICY-TYPE") == "POLICYREPORT" {
|
||||
pc.policySync.mux.Lock()
|
||||
pc.policySync.policy = append(pc.policySync.policy, key)
|
||||
pc.policySync.mux.Unlock()
|
||||
return nil
|
||||
}
|
||||
for _, v := range grList {
|
||||
if key == v.Spec.Policy {
|
||||
err := pc.kyvernoClient.KyvernoV1().GenerateRequests(config.KubePolicyNamespace).Delete(v.GetName(),&metav1.DeleteOptions{})
|
||||
|
@ -452,6 +446,12 @@ func (pc *PolicyController) syncPolicy(key string) error {
|
|||
}
|
||||
}
|
||||
}
|
||||
if os.Getenv("POLICY-TYPE") == "POLICYREPORT" {
|
||||
pc.policySync.mux.Lock()
|
||||
pc.policySync.policy = append(pc.policySync.policy, key)
|
||||
pc.policySync.mux.Unlock()
|
||||
return nil
|
||||
}
|
||||
go pc.deletePolicyViolations(key)
|
||||
// remove webhook configurations if there are no policies
|
||||
if err := pc.removeResourceWebhookConfiguration(); err != nil {
|
||||
|
@ -480,7 +480,6 @@ func (pc *PolicyController) syncPolicy(key string) error {
|
|||
pc.resourceWebhookWatcher.RegisterResourceWebhook()
|
||||
engineResponses := pc.processExistingResources(policy)
|
||||
pc.cleanupAndReport(engineResponses)
|
||||
pc.resourceWebhookWatcher.RegisterResourceWebhook()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue