Preserve existing behavior with go1.22/1.23 alias type parsing#281
Preserve existing behavior with go1.22/1.23 alias type parsing#281k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
/hold for CI and validation in kubernetes |
|
Testing in kubernetes/kubernetes#127271 |
|
/hold cancel |
thockin
left a comment
There was a problem hiding this comment.
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 DetailsNeeds 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 <sayboras@yahoo.com>
|
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)