1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-13 19:28:55 +00:00

fix: generate flake (#8332)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-09-11 15:04:57 +02:00 committed by GitHub
parent 6073f2952e
commit 7a982a4c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -859,7 +859,9 @@ func (c *controller) mergeWebhook(dst *webhook, policy kyvernov1.PolicyInterface
// matching kinds in generate policies need to be added to both webhook
if rule.HasGenerate() {
matchedGVK = append(matchedGVK, rule.MatchResources.GetKinds()...)
matchedGVK = append(matchedGVK, rule.Generation.ResourceSpec.Kind)
if rule.Generation.ResourceSpec.Kind != "" {
matchedGVK = append(matchedGVK, rule.Generation.ResourceSpec.Kind)
}
matchedGVK = append(matchedGVK, rule.Generation.CloneList.Kinds...)
continue
}