Closed Lirt closed 3 years ago
It parses well when double curly braces are inside of string, so for example quoted like "{{ .testVersion }}", but also in case of yaml multi-line strings.
Which means this works for example.
---
kind: test
metadata:
name: test
spec:
version: |
{{ .testVersion }}
Hi, the unquoted inline scalar with inline double curly braces that you have in your example is not valid YAML, as far as I can tell. Different parsers produce different errors when trying to parse this, and yq could definitely do a better job of informing you that it's invalid, but you guessed correctly that the scalar needs to be quoted. Basically, unquoted { indicates the start of a flow mapping, and this scalar is not a valid flow mapping (and if interpreted as a mapping, wouldn't do what you intended anyway).
Thank you, it makes sense.
Maybe it will help somebody to track the error message in the future.
Hello,
I'm trying to parse yaml file with double curly brace pair (
{{ }}
). If the file contains a curly brace pair used for example in helm or Go templating, it fails with erroryq: Error running jq: TypeError: unhashable type: 'collections.OrderedDict'
.Here is example file you can try it on.
yq
version is2.12.0
.