-
Notifications
You must be signed in to change notification settings - Fork 408
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
newline discrepancy in CRDs generated by controller-gen #514
Comments
Fwiw, I tried |
We have the same issues in v0.3.0 |
I guess we can just run the controller-gen output through a YAML pretty-printer before committing it. It would seem reasonable to assume that's not necessary though. |
This happens after running Sorry for casting aspersions your way. (And working around it isn't a simple matter of piping things through |
Hi all, I also found this problem on my Mac (without line-breaking), but my colleagues all generate normally WITH line-breaking. I also tried on my Ubuntu VM, it also generates with line-breaking. I don't know what happens on my Mac, I also upgrade my Golang to 1.15 or upgrade/downgrade controller-gen version, they all didn't work. Do you have any other idea? Thanks! |
Hey all, I too got this problem on my Mac, even though my colleagues do not. @zhangtbj did you find a solution? Thanks |
Hi @PaulsBecks , I didn't fix it on my Mac, I switched to generate on my Ubuntu VM... :( |
1 similar comment
Hi @PaulsBecks , I didn't fix it on my Mac, I switched to generate on my Ubuntu VM... :( |
This seems to still be happening, without involving kustomize. On macOS YAML is generated with line wrapping, and on Ubuntu it's generated without line wrapping. Does anybody have any ideas what might cause this discrepancy? |
/reopen |
@dims: 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/test-infra repository. |
This requires kubernetes-sigs/yaml to bump to version v2.4.0. Actually v2.3.0 would fix it, but it would introduce many regressions to kubernetes, so v2.4.0 reverted the fix but introduced the method Edit: |
Confirm the issue on my macbook. Managed to mitigate like this:
Example: go get gopkg.in/yaml.v2
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 |
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 |
The Kubernetes project currently lacks enough active 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 rotten |
The Kubernetes project currently lacks enough active 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. /close |
@k8s-triage-robot: 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. |
Using controller-gen v0.4.0 (and older versions) for CRD generation on ubuntu, long descriptions are all on one line. On a Mac, they're broken across multiple lines. While both are equivalent from a YAML perspective, they're very different as far as git is concerned. This means if dev A on ubuntu commits a CRD, and then dev B on MacOS makes a change that is effectively a small change to the yaml, the git diff is huge and completely obscures the actual change. (And obviously the same happens if the order is dev B then dev A making changes.)
This makes it very difficult to review/understand CRD diffs and confuses devs.
Is there a way to make the outputs consistent? If not, then I'd consider this a bug.
As an example, here's what happens for one of the descriptions in our CRD when going from generated-on-Mac to generated-on-ubuntu. There is no diff yaml-wise but
git diff
includes:The text was updated successfully, but these errors were encountered: