Skip to content

Commit ac3c322

Browse files
authored
Use currentObject instead of desired to calculate lookupPatchMeta in the validation phase as well (#23)
1 parent 919bf6f commit ac3c322

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patch/patch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ func (p *PatchMaker) Calculate(currentObject, modifiedObject runtime.Object, opt
8686
// $setElementOrder can make it hard to decide whether there is an actual diff or not.
8787
// In cases like that trying to apply the patch locally on current will make it clear.
8888
if string(patch) != "{}" {
89-
patchCurrent, err := strategicpatch.StrategicMergePatch(current, patch, modifiedObject)
89+
patchCurrent, err := strategicpatch.StrategicMergePatch(current, patch, currentObject)
9090
if err != nil {
9191
return nil, emperror.Wrap(err, "Failed to apply patch again to check for an actual diff")
9292
}
93-
patch, err = strategicpatch.CreateTwoWayMergePatch(current, patchCurrent, modifiedObject)
93+
patch, err = strategicpatch.CreateTwoWayMergePatch(current, patchCurrent, currentObject)
9494
if err != nil {
9595
return nil, emperror.Wrap(err, "Failed to create patch again to check for an actual diff")
9696
}

0 commit comments

Comments
 (0)