You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to update one certificate inside an argo cd app project. While I am doing so it is not preserving the YAML format and making changes.
First I am fetching only the values part from the file and store in tmp-app.yaml yq '.spec.source.helm.values' app.yaml > tmp-app.yaml
Then update the certificate value in tmp-app.yaml from a variable yq ".oidc.caPEM |= (from_yaml | \"${ca_cert_content//$'\n'/\\n}\" | to_yaml)" -i tmp-app.yaml
Then I am loading the updated file back into the original file.
yq '.spec.source.helm.values = load("tmp-app.yaml")' -i app.yaml
Now I am facing issue in step 2 and 3.
Issues:
In step 2 all the blank lines are getting pruned and yq in increasing the indent as well.
In step 3 when i load the file it is removing (|-) from values.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to update one certificate inside an argo cd app project. While I am doing so it is not preserving the YAML format and making changes.
First I am fetching only the values part from the file and store in tmp-app.yaml
yq '.spec.source.helm.values' app.yaml > tmp-app.yaml
Then update the certificate value in tmp-app.yaml from a variable
yq ".oidc.caPEM |= (from_yaml | \"${ca_cert_content//$'\n'/\\n}\" | to_yaml)" -i tmp-app.yaml
Then I am loading the updated file back into the original file.
yq '.spec.source.helm.values = load("tmp-app.yaml")' -i app.yaml
Now I am facing issue in step 2 and 3.
Issues:
In step 2 all the blank lines are getting pruned and yq in increasing the indent as well.
In step 3 when i load the file it is removing (|-) from values.
My app.yaml format:
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: spec: source: values: |- oidc: caPEM: |
app.yaml after update:
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: spec: source: values: oidc: caPEM: |
I want to preserver '|-' after values and also any new line present under values.
Beta Was this translation helpful? Give feedback.
All reactions