1
0
Fork 0
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:
shivkumar dudhani 2019-07-24 06:33:51 -04:00
parent 3b16149e29
commit 0831839910

View file

@ -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)
}
}