-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
CRLF Issue with document headers #1871
Comments
Digging into this - it seems like its an issue with the underlying go-yaml parse :/ possibly related to go-yaml/yaml#893. If it helps, I noticed that if the input yaml has an extra line break between the document separator and the document 2 comment, then it works
|
I noticed release https://github.com/mikefarah/yq/releases/tag/v4.40.1 which mentions removing the dependency on go-yaml, so I figured I give this a test (with v4.43.1), and unfortunately this didn't fix this issue. In fact, the output is different now: # document 1 start comment
test:
sub:
key: value
# document 2 start comment
---
foo:
bar:
key: value Notice the additional blank line between "document 2 start comment" and the document separator. |
Just a note on why this matters... If you use |
Platform: Windows
Input file:
Line Ending: CrLf
yq '.' test-in.yaml
:Note how the "document 2 start comment" has moved from the top of the second document to the bottom of the first document!
This is causing havoc with the Kubernetes manifest that I'm manipulating with
yq
...If I explicitly change the line endings of
test-in.yaml
to UNIX-style "Lf", the issue does not appear.Originally posted by @boekhold in #1860 (comment)
The text was updated successfully, but these errors were encountered: