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
AZS='["eu-west-1b","eu-west-1a"]'
yq -i '.spec.template.spec.requirements[] |= if .key == "topology.kubernetes.io/zone" then .values = (env.AZS | from_json) else . end' argo-apps/karpenter/provisioners/base-nodepool.yaml
Actual behavior
Error: 1:39: lexer: invalid input text "if .key == \"topo..."
Expected behavior
It should replace whatever is in the values in the key: "topology.kubernetes.io/zone"with: ["eu-west-1b", "eu-west-1a"]
Additional context
I was able to get it to work by using the below command (simple array lookup) but what if someone juggles these around? Would be nice to lookup by key but obviously I am doing it wrong or it is unsupported.
Describe the bug
Error: 3:5: lexer: invalid input text "if .key == "topo..."
Version of yq: 4.X.X
Operating system: mac/linux/windows/....
Installed via: docker/binary release/homebrew/snap/...
mac homebrew
yq (https://github.com/mikefarah/yq/) version v4.45.4
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
input.yml:
output.yml:
Command
The command you ran:
Actual behavior
Expected behavior
Additional context
I was able to get it to work by using the below command (simple array lookup) but what if someone juggles these around? Would be nice to lookup by key but obviously I am doing it wrong or it is unsupported.
yq -i '.spec.template.spec.requirements[1].values = env(AZS)' argo-apps/karpenter/provisioners/base-nodepool.yaml
The text was updated successfully, but these errors were encountered: