-
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
Let kyaml keep white space formatting #3559
Comments
Can you provide an example that can demonstrate what kind of whitespace format is changed? |
kyaml alos borks ConfigMaps, ref: fluxcd/image-automation-controller#68 (comment) |
@monopole This is an example of the indentation differences in go-yaml. @stefanprodan What's the version of kustomize are you using. The issue in your image is different from the one that @jonaskello reported. |
@Shell32-Natsu fluxcd/image-automation-controller doesn't uses kustomize as a whole, but kyaml as a library:
|
@stefanprodan OK that should be a different issue. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale This is still an issue AFAIK. |
This looks to me like the changes we saw when attempting to bump go-yaml in #3789. So it's ultimately being caused by kyaml using a different go-yaml version than your other tool, and go-yaml.v3 making what I'd consider to be a breaking formatting change. Since Kustomize has long emitted the older format, we have been investigating the possibility of avoiding the change, which will likely be disruptive to many users. Relevant to this particular issue, it seems likely that that will require kyaml to interfere with the whitespace formatting goyaml currently forces. @Shell32-Natsu how feasible is that looking? |
@stefanprodan would you please take a look at the discussion in #3946 and comment there? Thanks! |
Per #3946, the underlying yaml lib we use changed its indentation style, causing diffs like this. Kustomize pinned to an older version to keep the indentation stable, but we couldn't automatically do the same for folks using kyaml directly. As of kyaml 0.11.0, kyaml itself also uses kustomize's preferred indentation style. The next release of kyaml will contain #4043, which allows kyaml/yaml users to override the default style, and kyaml/kio to detect and retain the style in the source document. /close |
Is your feature request related to a problem? Please describe.
Using fluxcd2 with ImageUpdateAutomatation it will rewrite the kustomization.yaml file using kyaml and in doing so all whitespace is altered. Flux will commit these changes back into a gitops repo. In that commit the whole file looks like it has changed but all changes are whitespace only except for one line. This makes it very hard to tell what really changed from just looking at the commit diff. See this issue for more background.
Describe the solution you'd like
I would like
kyaml
to preserve white space formatting so that flux can commit without whitespace changes.The text was updated successfully, but these errors were encountered: