mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
handled skipped element in array
This commit is contained in:
parent
3b16149e29
commit
0831839910
1 changed files with 4 additions and 4 deletions
|
@ -27,12 +27,12 @@ func Mutate(policy kubepolicy.Policy, rawResource []byte, gvk metav1.GroupVersio
|
|||
// Process Overlay
|
||||
if rule.Mutation.Overlay != nil {
|
||||
overlayPatches, err := ProcessOverlay(rule, rawResource, gvk)
|
||||
if err != nil {
|
||||
ri.Fail()
|
||||
ri.Addf("overlay application has failed, err %v.", err)
|
||||
} else {
|
||||
if err == nil && len(overlayPatches) > 0 { // if array elements dont match then we skip(nil patch, no error)
|
||||
ri.Addf("Rule %s: Overlay succesfully applied.", rule.Name)
|
||||
allPatches = append(allPatches, overlayPatches...)
|
||||
} else {
|
||||
ri.Fail()
|
||||
ri.Addf("overlay application has failed, err %v.", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue