Using YQ for reading and editing YAML files
2021, Mar 21
Where this might come handy? GitOps !
In cases like updating values.yaml files when using Helm charts. Updating docker image versions in CI/CD pipelines , to trigger changes & sync in K8S tools. Editing any other file yaml, which carry versions and etc.
Lets take sample YAML file , called “test.yaml” with following content :
Lets select “martin” node
Output
Now lets try to edit “name” field within YAML file with YQ :