mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-17 17:56:33 +00:00
Fix panic in background controller when updating Generate rule (#11835)
Signed-off-by: Rokibul Hasan <mdrokibulhasan@appscode.com>
This commit is contained in:
parent
25032e363f
commit
5573e5cded
1 changed files with 4 additions and 0 deletions
|
@ -296,6 +296,10 @@ func ruleChange(old, new kyvernov1.PolicyInterface) (_ kyvernov1.PolicyInterface
|
|||
} else {
|
||||
ruleRsrc := ruleResource{rule: oldRule.Name}
|
||||
old, new := oldRule.Generation, newRule.Generation
|
||||
if old == nil || new == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if old.ResourceSpec != new.ResourceSpec || old.Clone != new.Clone {
|
||||
ruleRsrc.kinds = append(ruleRsrc.kinds, old.ResourceSpec.GetKind())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue