Yq: Anchors not working

Created on 24 Sep 2018  路  11Comments  路  Source: mikefarah/yq

yq r - <<EOF
serv:
  lol:
    <<: &s
      bar: ko
    foo: ok
  wat: *s
EOF

serv:
  lol:
    foo: ok
  wat:
    bar: ko

it should give

serv:
  lol:
    bar: ko
    foo: ok
  wat:
    bar: ko
bug yaml-v3

Most helpful comment

All 11 comments

Yep can confirm, looks like its an issue in the underlying yaml library I'm using - and they won't fix it until v3 comes out.

https://github.com/go-yaml/yaml/issues/184#issuecomment-371859215

go-yaml.v3 is available [blogpost here]!

Any update on this issue?

we're bumping into this too and have to use fun python scripts to work around this functionality.

Not a biggy but would be ace if it could follow anchors

@mikefarah Do you have an ETA for fix this problem?

The problem is that to use the v3 library I basically need to rewrite yq. Just don't have the time for that atm :(

Ok man, I completely understand you. Take your time.

The problem is that to use the v3 library I basically need to rewrite yq. Just don't have the time for that atm :(

I will try to support this feature

Just released a new version of yaml that fixes this - it's a pretty significant update so it's still in beta: https://github.com/mikefarah/yq/releases/tag/3.0.0-beta

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgm3 picture rgm3  路  7Comments

mdubinko picture mdubinko  路  8Comments

infa-ddeore picture infa-ddeore  路  5Comments

tamalsaha picture tamalsaha  路  5Comments

cdaguerre picture cdaguerre  路  4Comments