Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values with custom tags are set to null #23

Closed
GroovyCarrot opened this issue Mar 28, 2018 · 5 comments
Closed

Values with custom tags are set to null #23

GroovyCarrot opened this issue Mar 28, 2018 · 5 comments

Comments

@GroovyCarrot
Copy link

So I have an ansible playbook which has tags like this:

some_key: !vault |
  $ANSIBLE_VAULT;1.1;AES256
  37663434363236326231303035313330356563343734393664373764333962663539623031346531
  6335383361386661613563386265326264613738353632310a633162393366636362633835633430
  34313038633233646432646335643336643234613133643734303530616137366132313038343035
  3039313262386130350a626364633935643562376366306631626530663037376630613565373164
  6261

When trying to extract this, to pipe it into a decrypt:

$ yq '.some_key' file.yml
null

It would be more useful to just ignore tags that aren't recognised and pull the value out as-is, rather than just nulling the value out entirely. It might be a trivial to expose tags separately if you need them?

$ yq --tags '.some_key' file.yml
[
  "vault"
]
@kislyuk
Copy link
Owner

kislyuk commented Mar 30, 2018

I pushed a solution for this, but I'm wary of unexpected behavior with this. YAML tags are very troublesome and generally I'd like to do as little as possible to support them.

@kislyuk
Copy link
Owner

kislyuk commented Mar 30, 2018

@GroovyCarrot and @andrewbaxter, I'd appreciate if you tested master and commented on whether this suits your needs or if you see any caveats.

@andrewbaxter
Copy link

I like this better than the previous null stuff. I haven't been extracting data from within the tags so it's hard for me to say if there are hidden issues with this approach. My scripts are still working though.

@kislyuk
Copy link
Owner

kislyuk commented Apr 2, 2018

Released in v2.5.0.

@GroovyCarrot
Copy link
Author

Just had a chance to test, works perfectly 👍 thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants