How to update a YAML file with scalar (|-) YAML embedded #1345
Unanswered
nicknarcise
asked this question in
Q&A
Replies: 1 comment
-
See https://mikefarah.gitbook.io/yq/operators/encode-decode#update-a-multiline-encoded-yaml-string for an example on how to update that string |
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.
-
I am new to YQ and trying to understand how to query and essentiallly update a YAML file that contains scalar YAML values but having a hard time understanding how to query the values and essentially update a value in place

Trying to update tag version inplace for one of the deployments but having a hard time understanding how to do this with block scalars (|-). I can seem to do "yq e '.spec.source.helm.values' but not sure how to access --> deployments for etl-one or two then update the image.tag: values
spec:
source:
helm:
values: |-
deployments:
- name: "etl-one"
image:
repository: "xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/etl-one"
tag: "v1.0.7"
- name: "etl-two"
image:
repository: "xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/etl-two"
tag: "v1.0.2"
Not sure if someone can assist me in understanding or point me to how to do this with block scalars

Beta Was this translation helpful? Give feedback.
All reactions