How to merge from properties file without losing fields? #1406
Unanswered
Desolar1um
asked this question in
Q&A
Replies: 1 comment
-
Hi, the reason it's doing that is because by default arrays are clobbered when merging see https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-deeply-merging-arrays for more info. Too deeply merge arrays, you need to use
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am very new to YAML and yq, so Id like to ask for your patience with me here.
I have the following file
I wish to use a properties file to change the value of
server_name
.static_resources.listeners.0.filter_chains.0.filters.0.typed_config.server_name=NEW_NAME_TEST
When I run the following command, server_name is changed as intended, however I lose the rest of the information from the
listeners
block.yq '. *= load_props("new-config.properties")' config.yaml
Expected result:
Actual Result
EDIT: I have a lot of fields that need editing in this way, and I think a properties file would make the most sense for my use case.
Beta Was this translation helpful? Give feedback.
All reactions