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

[feature request] additional YAML helper functions #1845

Open
akamensky opened this issue Nov 22, 2023 · 2 comments
Open

[feature request] additional YAML helper functions #1845

akamensky opened this issue Nov 22, 2023 · 2 comments

Comments

@akamensky
Copy link

Consul Template version

v0.35.0
actually used from Nomad template stanza

Request

consul-template and places where it is used (like Nomad template stanza) have methods like parseYAML, toYAML etc. However a few are missing that could make this much more useful:

  • mergeYAML -- merge 2 YAML objects allowing override leaf nodes of one with values of another. mergeMap[WithOverride] does not work here as YAML gets map[inertface{}]interface{}, but explode gets map[string]interface{}.
  • treeYAML -- read KV tree as YAML object, where standard YAML type inference is used. tree can be read, but it assumes everything is a string, for example with KV tree like config/app/key = 21 reading it as {{ tree "config/app" | toYAML }} will yield key: "21", which obviously is not what would be expected.
@akamensky
Copy link
Author

added mergeYAML in #1846

@akamensky
Copy link
Author

added treeYAML method in #1847

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

1 participant