-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve on jk patch #128
Comments
This is nice for merging a literal into another value ✔️ I think we will always need a procedure which will merge two values that came from computation or a file, since going through and annotating such a thing would be painful. (It doesn't have to unconditionally do deep-merge). |
Other things we talked about:
|
Just wanted to put some other known merge/patch strategies on the table:
|
Also the merge behaviour in Hiera |
There are many merging strategies, eg.:
At the lower level, we should be able to configure the merging strategy for specific paths in objects. So it would look like:
If unspecified, we need a default: I think it'd be nice of the right hand side of Once we have that low level representation and if we want to support jsonnet patches, it should be straightforward to take a jsonnet patch and compile down a set of |
Another source of inspiration: https://reclass.pantsfullofunix.net/ |
Currently,
patch
will always "deep merge" objects, ie, given:We could support an alternative merging strategy, which is to replace the value instead of deep merging it:
Jsonnet let people the choice of the strategy. By default, it will override the value but, by appending a
+:
operator to the key, the user can signal they want a deep merge instead (look for "+:" in the page: https://jsonnet.org/learning/tutorial.html)We could support something similar, even borrowing the syntax:
We could also make the '+' work for arrays and say, concatenate arrays of replacing them.
The text was updated successfully, but these errors were encountered: