Replies: 2 comments
-
You can do it like this:
Explanation:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
This works absolutely beautifully! Thanks Mike! |
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'm trying to 'patch' a large Helm manifest using the Helm postrenderer feature calling out to a shell script that runs YQ on its STDIN. One of the "patches" I need to do is to append an entry to the "env" of a container inside a deployment. The value of one of the fields in that object needs to be quoted, either single-quoted or double-quoted.
I have figured out how to append the additional entry to the array, but I can't figure out how to do the quoting.
I've reduced the scenario to the following test case:
helm manifest file 'manifest.yaml':
YQ expressions file 'patch.yq':
The specific expression that I'm having trouble with is the one in the middle, related to "app2".
Executing this with:
cat manifest.yaml | yq --from-file patch.yq
This correctly adds the
ENVVAR3
entry to the Deployment, but the value is unquoted. I've been experimenting with thestyle="single"
(and double) expression, but have been unable to figure out how to quote /just this one value/.Any suggestions on how to implement this requirement?
Beta Was this translation helpful? Give feedback.
All reactions