-
Notifications
You must be signed in to change notification settings - Fork 195
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
Preserve existing behavior with go1.22/1.23 alias type parsing #281
Conversation
/hold for CI and validation in kubernetes |
Testing in kubernetes/kubernetes#127271 |
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct. We should just rename gengo's own "alias" to "typedef".
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is the manual backport of the below PR to v1. Relates: kubernetes#281
This is the manual backport of the below PR to v1. Relates: kubernetes#281 Signed-off-by: Tam Mach <[email protected]>
I came across this PR while working on cilium/cilium repo. Thanks a lot for your awesome work. Not sure if this is the right place, I am just curious if k8s.io/gengo (not k8s.io/gengo/v2) is still supported. If yes, do we need to do the same for k8s.io/gengo package? Thanks. |
gengo is EOL and will not receive such updates. gengo/V2 has significantly changed internally, and we opted to declare it a "virtually private" repo, primarily for use in kubernetes. IOW, the compatibility contract is more or less waived. Is cilium using gengo? I was not aware of that (didn't look too hard, honestly). If so, can you tell us more about the use-case? |
Thanks for your reply.
Cilium is using a forked deepequal, which still relies on gengo v1. It seems like the cleanest path is to upgrade to gengo/v2. |
I see. I want to repeat, just so there's no confusion, gengo v2 is not really a supported api, and if you use it outside of the kubernetes project we're not making very strong API guarantees. That doesn't mean we're going to break it on purpose, but it might mean that we are a little cavalier about changes. For example, we didn't really write a conversion guide for V1 users. So as you undertake this, if you undertake this, let me know if you struggle to figure out what changed. |
It's already the case nevermind sorry for the noise |
go/types returns different content for aliases in go1.23 by default, which breaks or unexpectedly modifies the type parsing / walking encountered by generators.
https://tip.golang.org/doc/go1.23#gotypespkggotypes
Encountered when bumping k/k to go 1.23 - kubernetes/kubernetes#127271 (comment)