1
0
Fork 0
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 ()

Signed-off-by: Rokibul Hasan <mdrokibulhasan@appscode.com>
This commit is contained in:
Rokibul Hasan 2025-01-03 14:45:06 +06:00 committed by GitHub
parent 25032e363f
commit 5573e5cded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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())
}