-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Long lines are broken with space in them #3969
Comments
Looks like this is the issue in go-yaml go-yaml/yaml#387. kustomize depends on go-yaml v2 indirect through sigs.k8s.io/yaml v1.2.0. So we need to wait for sigs.k8s.io/yaml to update. |
Hi, |
I'm experiencing this in |
I have this issues with helm:
and output in deployment (broken lines)
This bug still exists in version v4.3.0. Is this work scheduled for the next release? Is there any way to fix this bug now? |
The bug is likely in the go-yaml libraries that we use. Kustomize does not have the resources to address this bug at the moment, but anyone is welcome to investigate and submit a PR to either kustomize or go-yaml for review. |
This seems to happen for any string longer than 80 characters in your patches. I'm surprised it's not getting a lot more attention. It's a pretty huge limitation. I'm having to resort to using python yaml parsing to handle these operations. |
Does anyone know if this issue has been fixed? |
Bumping sigs.k8s.io/yaml to v1.3.0 doesn't seem to fix it (at least not by bumping it on v4.3.0, I cannot speak for later releases). |
Actually, interesting, I discovered that infinite lines was brought in with go-yaml v2.30 (https://github.com/go-yaml/yaml/releases/tag/v2.3.0) but was then reverted again (apparently largely because the Kubernetes community wanted it) in v2.40 (https://github.com/go-yaml/yaml/releases/tag/v2.4.0) kubernetes-sigs/yaml v1.3.0 bumps go-yaml to from v2.2.8 to v2.4.0. I will investigate with v2.3.0, but I am guessing it will have some surprises as well if folks wanted it reverted. |
A few things I learnt: kustomize doesn't just use sigs.k8s.io/yaml but also uses go-yaml directly in several places. There is also a forked go-yaml that is sometimes used. Anyway, I tried setting all direct references to 2.3.0 and also created a forked sigs.k8s.io/yaml that I set to use 2.3.0 as well. Also had to fork apimachinery since it was also pegged to 2.4.0. None of this appears to have had any effect. Long lines are still broken up, so either I am missing a reference somewhere, or the solution requires additional code changes that I have no idea where to implement. Could anyone from the core kustomize team comment? |
Ok so I finally figured it out. The direct references to go-yaml don't play any role whatsoever. This right here is where the magic happens: https://github.com/kubernetes-sigs/yaml/blob/v1.3.0/yaml.go#L82. To have this work without line breaks you just need to call If it really is as simple as this, could we get this as command line arg? |
For the record, kustomize 4.5.2 still exhibits this behavior. |
@natasha41575 Given that 4.5.2 doesn't fix it and what @karlschriek has found, do you have any further ideas about what needs to happen here? |
Let me also link this PR, which would actually solve the issue #4222 (comment), although I doubt whether it will be merged in its current form. The consensus from the Kubernetes community seems at the moment to be that the line-wrapping should be kept, since changing it would causes several tests to break. For us it would be sufficient to have kustomize "init" with |
/close Duplicate of #947, which is older / has more history. Please watch that one intead. |
@KnVerey: The label(s) 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/test-infra repository. |
Describe the bug
When upgrading to the 4.0.5+ from 4.0.4 longs lines with spaces in the yaml are broken. Looks similiar to #947 but that was fixed in older versions (this wasn't an issue in 3.8.x+).
Files that can reproduce the issue
Example:
kustomization.yaml
test.yaml
Expected output
Actual output
Kustomize version
4.0.5+ including 4.1.x
Platform
linux
Additional context
The text was updated successfully, but these errors were encountered: