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

delete generate request if policy is deleted (#1036)

This commit is contained in:
Yuvraj 2020-08-10 22:42:11 +05:30 committed by GitHub
parent 73840e3c5f
commit 4cb0e564d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,5 +262,13 @@ func (c *Controller) syncGenerateRequest(key string) error {
if err != nil {
return err
}
_, err = c.pLister.Get(gr.Spec.Policy);
if err != nil {
if !errors.IsNotFound(err) {
return err
}
c.control.Delete(gr.Name)
return nil
}
return c.processGR(*gr)
}