Replies: 3 comments 4 replies
-
The problem is that the file is not valid yaml - it's a template file for generating yaml. When the underlying yaml parser reads it - it produces strange results :( |
Beta Was this translation helpful? Give feedback.
-
I run this ed script after yq
to fix the {? {stuff: ''}: ''} with {{stuff}} PS: I hope some enjoys, it took me some time to login back here just to comment |
Beta Was this translation helpful? Give feedback.
-
@verliba , could you explain your answer as I have the same issue, and this will help me |
Beta Was this translation helpful? Give feedback.
-
Hello,
I should manipulate an helm chart file like this:
I would replace the MY_PROP_1: {{ .Values.configuration.myFirstProp }} with MY_PROP_1: {{ .Values.deploy.myFirstProp }}.
Trying with the yq command:
yq '.data.MY_PROP_1 = "{{ .Values.deploy.myFirstProp }}"' YQ/configmap-env.yaml
I have this strange result:
Problem 1: The MY_PROP_1 value is replaced by adding the single quotes.
Problem 2: Also other props MY_PROP_2 and MY_PROP_3 have been replaced with strange characters --> {? { the_value}: "}
The goal is to replace only the MY_PROP_1 property, avoiding single quotes. How to do that? Please note that normal yaml file with values without bracket works as expected.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions