Replies: 1 comment 1 reply
-
Hmm investigated and debugged this morning. I found that using the following envNewNodeYaml="${__newNodeYaml}" yq e --inplace '.vmrules += env(envNewNodeYaml) ' "./myYamlFile" Avoids the Now, I'm curious why it works. As I would like to understand why it does so. Thank you very much and have a great day. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I have this YAML Array:
I'm trying to add this yaml block scalar to the
vmrules[]
Array.However, when I do so with:
yq e --inplace '.vmrules += "'"$testSpasWorker35Yaml"'"' ../test-spas.yml
this is the result:How can I avoid the
|-
in the output. When|-
is in the output further yq queries no longer act the same, as on entries thevmrules
array that DO NOT have|-
. E.g.yq '.vmrules[]."test-test-worker-35"
is not working. I need this and other of yq type queries to work as they do when the block scalar is not in the output.I've tried using the
... style = ""
option. I've further tried:yq
operators. But, haven't found one of use in this case ( as far as I can see )yq e --inplace '.vmrules |= . + ["'"$testSpasWorker35Yaml"'"']' ../test-spas.yml
Further, I've read:
Please help here. Much appreciated.
Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions