-
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
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).
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 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale
|
I tried to reproduce and can confirm that this still happens on the current version. However it only happens on a very specific situation:
Example: If we have this
It will still happen The solution is to remove white space from the helm notation |
Maybe that happens in |
I got here via kubernetes-sigs/yaml#116, and I'm not sure I understand the issue... the output appears to be correct and round-trippable to me |
This issue is caused by inserting I believe fixing this problem is difficult because it requires modifications to the yaml library.
Can you try to resolve the issue with the above workaround? Feel free to reopen this issue if somebody has any additional problems or something. |
@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. |
/reopen |
@cprivitere: Reopened 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. |
Ignore my previous comment here. We've worked around this in our code base and I'm coming around to @liggitt 's way of thinking that if it's round trippable this is an issue for elsewhere. Re-closing. |
/close |
@cprivitere: 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. |
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: