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:
parent
176f139f26
commit
ee19d49a94
2 changed files with 15 additions and 0 deletions
|
@ -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{}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Add table
Reference in a new issue