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:
parent
73840e3c5f
commit
4cb0e564d4
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue