-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for JSON Patch #169
Comments
Kustomize uses stategic patch for types with schema and json patch for types without schema. |
Kustomize uses JSON Merge Patch (RFC 7396) for types without schema. I am referring to JSON Patch (RFC 6902). The command description for |
IMO we should support other patch types. |
yep, agreed |
one possible implementation: when applying a patch, check if it is a JSON patch. If it is, apply it as JSON patch. Otherwise, use current approach. |
As far as I understand, the patch description just needs to include this info ( kustomize/pkg/resource/resid.go Lines 25 to 39 in e5aea44
|
We will need |
We can use ObjectReference to specify which object the JSON patch is applied to. There is one more concern. In a JSON patch, one can have operations for changing the object's I suggest to skip the operations for changing the object |
Yes, disallow name change in patch until we edfine a safe approach (and someone asks for it). |
I created POCs for two different approaches. @mxey @ivan4th @sethpollack, can you take a look and let us know your feedback from an user aspect. Thank you. #286 adds a new filed
This approach is backward compatible, but doesn't have good extend-ability. If we need to support another kind of patch in the future, we have to add new fields in #295 doesn't introduce new filed in kustomization.yaml, but allow current
This approach is backward compatible and have good extendability. The drawback is this approach will make Kustomization API unstructured. |
From a user perspective, either one would work for me. Regarding supporting multiple patch types in |
@Liujingfang1 Thanks for showing both methods. I'm in favor of defining new fields. Suggest
We can keep Later, as desired we could add
Prefixing all these directives with |
Sometimes, the strategic merge patch or JSON merge patch approach does not merge in a way one would like. For example, Ingress rules are replaced entirely.
kubectl patch
supports the JSON Patch standard. It would be useful for Kustomize to support it as well.The text was updated successfully, but these errors were encountered: