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

Return first non-empty YAML document when parsing YAML streams #683

Merged
merged 1 commit into from
Nov 16, 2019

Conversation

hairyhenderson
Copy link
Owner

This relates to #534, and while full multi-document stream support is going to take a bit longer to fully figure out, I think this is a quick win.

Basically this handles the (not uncomment in Helm and Kubernetes-land) case where a file like:

# foo
---
foo: bar

will get parsed by gomplate as just a single nil, which is pretty much never what we actually want.

So now YAML will ignore non-empty documents and return the first one in the stream.

Signed-off-by: Dave Henderson dhenderson@gmail.com

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson merged commit a9fd2b8 into master Nov 16, 2019
@hairyhenderson hairyhenderson deleted the return-first-non-empty-yaml-doc branch November 16, 2019 00:11
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

Successfully merging this pull request may close these issues.

1 participant