mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +00:00
fix: exclude autogen rules when autogen internals is enabled (#4370)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
parent
e02dbc17d3
commit
fb93595397
1 changed files with 5 additions and 1 deletions
|
@ -296,7 +296,11 @@ func computeRules(p kyvernov1.PolicyInterface) []kyvernov1.Rule {
|
|||
return spec.Rules
|
||||
}
|
||||
var out []kyvernov1.Rule
|
||||
out = append(out, spec.Rules...)
|
||||
for _, rule := range spec.Rules {
|
||||
if !isAutogenRuleName(rule.Name) {
|
||||
out = append(out, rule)
|
||||
}
|
||||
}
|
||||
out = append(out, genRules...)
|
||||
return out
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue