1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-04-08 10:04:25 +00:00

Fix autogen issue

This commit is contained in:
Vyankatesh Kudtarkar 2021-10-07 16:21:39 +05:30
parent 176f139f26
commit ee19d49a94
2 changed files with 15 additions and 0 deletions

View file

@ -144,6 +144,13 @@ func generateCronJobRule(rule kyverno.Rule, controllers string, log logr.Logger)
return *cronJobRule
}
if (jobRule.Mutation != nil) && (jobRule.Mutation.ForEachMutation != nil) && (jobRule.Mutation.ForEachMutation.PatchStrategicMerge != nil) {
cronJobRule.Mutation = &kyverno.Mutation{
ForEachMutation: jobRule.Mutation.ForEachMutation,
}
return *cronJobRule
}
return kyvernoRule{}
}

View file

@ -724,6 +724,14 @@ func generateRuleForControllers(rule kyverno.Rule, controllers string, log logr.
return *controllerRule
}
if rule.Mutation.ForEachMutation != nil && rule.Mutation.ForEachMutation.PatchStrategicMerge != nil {
newForeachMutation := &kyverno.Mutation{
ForEachMutation: rule.Mutation.ForEachMutation,
}
controllerRule.Mutation = newForeachMutation.DeepCopy()
return *controllerRule
}
if rule.Validation.Pattern != nil {
newValidate := &kyverno.Validation{
Message: variables.FindAndShiftReferences(log, rule.Validation.Message, "spec/template", "pattern"),