Replies: 1 comment
-
Hi, This is just a order precedence problem, what you need to do is only select that document for the update, as opposed to selecting the document and then updating it. TLDR: you need brackets yq4 '(select(document_index == 1) | .entries) += {"name": "private-worker-agent.v"+ env(VERSION), "replaces": "private-worker-agent.v2.2.32"}' operator.yaml |
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
-
Hi,
I have a yaml file that contains multiple documents:
I would like to update only the document at index 1 to add new entries. I tried:
This returns:
But it doesn't output all the other document indexes. How is it possible to update the document at index 1 and just output all other documents as untouched.
Thanks for any help. I am using
yq 4.25.2
.I tried with yq 2.4.1 using -d 1. Seems to work, but I cannot figure out how to insert a new entry with that version.
Beta Was this translation helpful? Give feedback.
All reactions