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

Support multiple documents in single file #14

Closed
braydonk opened this issue Aug 23, 2022 · 2 comments · Fixed by #19
Closed

Support multiple documents in single file #14

braydonk opened this issue Aug 23, 2022 · 2 comments · Fixed by #19
Milestone

Comments

@braydonk
Copy link
Collaborator

braydonk commented Aug 23, 2022

The default Unmarshal behaviour in yaml.v3 will only read and output the first document in a multi-document yaml file. I was unaware that this was possible, let alone common in Kubernetes so I did not test it initially.

The way to make yaml.v3 parse these properly is to to make a Decoder for the whole document, and decode them one at a time in a loop. This behaviour might diverge heavily from the basic formatter, so it might need to be an entirely new one, but I will see if I can make it work by default.

@braydonk braydonk changed the title Support Multiple Documents Support multiple documents in single file Aug 23, 2022
@braydonk
Copy link
Collaborator Author

Since this looks like it will take more thought than the other v0.2.0 things, I'm going to target this for v0.3.0.

@braydonk braydonk added this to the v0.3.0 milestone Aug 23, 2022
@braydonk
Copy link
Collaborator Author

Actually now that I've looked into this it's pretty doable. Gonna put it in v0.2.0

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 a pull request may close this issue.

1 participant