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
Line breaks on long strings with spaces #947
Comments
I think if go-yaml/yaml#455 gets merged that might be the signal to migrate to yaml.v3, and unlimited line lengths... |
This behavior is still in v3.0.1. Using the same input files, the output has line breaks: apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app.version: '{{ .Values.services.mariadb.app.version }}'
name: test
spec:
template:
spec:
containers:
- image: thisIsAReallyLongRepositoryLinkThatResultsInALineBreakWhenBuildingWithKustomize/mariadb:{{
.Values.services.mariadb.image.version }} |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Hi guys, there is a workaround for this issue? |
Have the same issue here. Need to keep the formatting as is without breaking long lines. Any ideas? |
@kristofferahl, we worked around this by using:
Not sure if this is semantically 100% equal, though. It mitigated the issue in our specific case. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: 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/test-infra repository. |
/reopen |
@laverya: You can't reopen an issue/PR unless you authored it or you are a collaborator. 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. |
There's a fix in gopkg.in/yaml.v2, now released as v2.3.0 - I'll make a PR to update kustomize to this version. (basically, if the string doesn't have newline literals in it, v2.3.0 won't split the string over multiple lines when encoding things - previously it would wrap before 80 characters) |
Just validated, and 3.6.1 still exhibits this behavior:
resources:
- deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 1
selector:
matchLabels:
component: test
template:
metadata:
labels:
component: test
spec:
containers:
- name: test
image: "test"
env:
- name: DATABASE_URL
value: postgres://{{repl ConfigOption "database_user"}}:{{repl ConfigOption "database_password"}}@db.{{repl Namespace}}.svc.cluster.local:5432/db yields this: apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 1
selector:
matchLabels:
component: test
template:
metadata:
labels:
component: test
spec:
containers:
- env:
- name: DATABASE_URL
value: postgres://{{repl ConfigOption "database_user"}}:{{repl ConfigOption
"database_password"}}@db.{{repl Namespace}}.svc.cluster.local:5432/db
image: test
name: test
|
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: 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/test-infra repository. |
Unfortunately this generated a lot of changes because descriptions are no longer word-wrapped - it looks like this was a change made to kustomize last year: kubernetes-sigs/kustomize#947 Also includes the recently added ipTags on AzurePublicIPAddresses.
Unfortunately this generated a lot of changes because descriptions are no longer word-wrapped - it looks like this was a change made to kustomize last year: kubernetes-sigs/kustomize#947 Also includes the recently added ipTags on AzurePublicIPAddresses.
The new version of kustomize no longer word-wraps long text fields like descriptions, which causes a lot of churn in the files. This was changed in kubernetes-sigs/kustomize#2678 released with kustomize 3.7.0 (after discussion on this bug kubernetes-sigs/kustomize#947).
v2 of go-yaml already exposes the option to change this behaviour. In fact, it was temporarily the default in v2.3 of that library, but the change was reverted at the request of the Kubernetes project in v2.4: go-yaml/yaml#670. This repo deliberately opted not to set it by default: kubernetes-sigs/yaml#62 (comment). Consumers who want the behaviour change should call Reading through the history here and on related issues, it sounds like Kustomize in particular has already thrashed on the wrapping behaviour. Indeed, we used the go-yaml version with the changed default between #2679 and #3667, which means v3.7.0 to v4.0.5 had no line limit set, and both before and after did. The revert was apparently specifically requested because of the kubectl integration, and we knew it would thrash the line length limit: #3664. Even if on the Kustomize side we could consider the wrapping to be purely a bug (such that we could accept the change in output as non-breaking and release without a major version bump), we would still have the problem of how to do it. Unfortunately |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
This problem is extremely annoying. Is there any updates? Unfortunately the following workaround not works in all cases:
This construction adds a |
If I read this correctly, this may be tied to the fate of kubernetes-sigs/yaml#76 |
adding
|
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
When combining helm templates with kustomize overlays, a line break is inserted when the line is very long and contains spaces.
Tested versions: 2.0.1 and 2.0.3
Using test/base.yml:
and test/kustomization.yml
results in
Expected Behavior:
app.version
label is enclosed in single quotes. I would expect that either the quotes are not removed at all or the quoting behavior is constantThe text was updated successfully, but these errors were encountered: