-
Notifications
You must be signed in to change notification settings - Fork 76
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
At "sigs.k8s.io/yaml/goyaml.v2"
, marshal output is incorrect when the string field is long and contains Colon and Space(:
)
#116
Comments
it's not clear to me that the resulting yaml is invalid... it round-trips correctly when unmarshaled (see https://go.dev/play/p/_v1ZSI-MnM3), and other yaml linters (e.g. https://www.yamllint.com/, https://yaml-online-parser.appspot.com/) validate it and appear to interpret it correctly |
Sorry, I didn't know about 'line folding' in the YAML specification. I mistakenly thought it looked like an unexpected extra line break had been added. a: '12345678901234567890123456789012345678901234567890123456789012341234567890123456789012345678901234567890123456789012345678901234:
.s' /close |
@koba1t: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@liggitt Do you mind to reopen this issue ? I'm facing the same issue and according to go-yaml/yaml#455 (comment) The YAML output becomes difficult to read and edit due to the line wrapping.
What about merging go-yaml/yaml#329 into the fork of goyaml.v2 ? |
We won't reopen this specific issue, since the output is not actually incorrect. Given that changing the line wrapping default in go-yaml broke things, and they had to back that change out, I'm not inclined to import that problem to this repo. More configurability / options in yaml output wouldn't help users of things like kubectl / kustomize, which would continue to keep compatible defaults using current wrapping behavior. |
Thanks for the explanation. I think about creating a fork, but I wonder if this is a good idea. Do you know what exactly breaks when the maximum line width is changed? I'm fine with increasing the maximum line to a fixed width, let's say 200 chars. Will this generate invalid yaml ? |
For kubectl / kustomize users, anything expecting stable (byte-equivalent) output in yaml format release-to-release. It's still semantically equal, but was not byte-equal |
What happened?
The marshal output is incorrect when the string field is long and contains Colon and Space(
:
) at"sigs.k8s.io/yaml/goyaml.v2"
pkg.How can we reproduce it (as minimally and precisely as possible)?
code
https://go.dev/play/p/WDmfH-PWqtW
output
Additionally
related to kubernetes-sigs/kustomize#947
The text was updated successfully, but these errors were encountered: