Question
What is the difference between patches vs patchesJson6902 in Kustomize
Based on the docs that I've read, there are 3 methods of patching:
- patches
- patchesStrategicMerge
- patchesJson6902.
The difference between patchesStrategicMerge
and patchesJson6902
is obvious. patchesStrategicMerge
requires a duplicate structure of the kubernetes resource to identify the base resource that is being patched followed by the modified portion of the spec to denote what gets changed (or deleted).
patchesJson6902
defines a 'target' attribute used to specify the kubernetes resource with a 'path' attribute that specifies which attribute in the resource gets modified, added, or removed.
However, what is not clear to me is the difference between patches
and patchesJson6902
. They seem to be very similar in nature. Both specify a 'target' attribute and operation objects which describes what gets modified.
The only difference I've noticed is that patches
does not require a 'group' attribute while patchesJson6902
does; The reason for this is unknown.
So why the difference between the two? How do I determine which one to use?