-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Strategy to deal with transitive depencencies on client-go <1.18 #88472
Comments
/sig api-machinery |
KEP is here: kubernetes/enhancements#1503 /assign @mikedanese |
Transitively depending on mixed versions of client-go are not supported in general. We should help major transitive dependencies update to 1.18 client-go levels as soon as possible after release. What dependencies are important to you? |
@mikedanese (I'm author of govendor tool and I now use go modules.) Honest question, why doesn't client-go issue a v2, v3 on obviously breaking changes? I understand you want to keep it in line with k8s releases, but still, there must be a way to do both at some level. Then clients could incrementally adopt versions. |
Last time I checked, we bumped the major version of client-go every minor release of Kubernetes:
However, it looks like that might no longer be the case after kubernetes/enhancements#1350, kubernetes/publishing-bot#210 where we moved to v0.x.y. Semver does allow breaking changes on these upgrades:
From https://semver.org/ It seems like the old tags would break |
@mikedanese Go modules does use semver as a guide, but "go mod" only puts major versions in their own package, thus only major versions can be gracefully upgraded. Due to that, breaking changes should bump the major versions so dependencies can gracefully upgrade on their own timeline. You can see what tags go modules recognize: https://pkg.go.dev/k8s.io/client-go/kubernetes?tab=versions Note that v12.0.0 isn't listed because the major tag version "v12" doesn't match the module suffix (missing v12, should be "module k8s.io/client-go/v12"). Versions prior to v12 show up because they lack the go.mod file and are thus grandfathered in with "+incompatible". Go has a good story for packages that break their API from release to release and allows consumers of them to gradually upgrade. It would be awesome to allow that. |
If the stated answer is that there is no API guarantee, I understand. That has been expressed in the pass so I have no complaint as I assume the risk of using k8s go API already knowing that. If there is no other guidance on how to mitigate the burden on the consumers then you can close this issue. |
Another outsider jumping in here (sorry 😅). I have no contribution history within the k8s project but I do have a significant experience with Go modules and their workflows for small and large Go projects. The problem of transitive dependencies on
Normally the pain of 1. would be caught by k8s itself as the builds of other components depending on the one with a breaking change would also start failing when upgrading. However 2. means that this pain is hidden from the k8s builds and instead jumps straight to downstream users. The filepath-relative Developers may need to do this even if they don't depend on k8s themselves but one of their transitive dependencies does: a From my understanding of the k8s project's setup there are actually some pretty decent solutions going forward if the team is interested in addressing these pain-points. I could potentially even provide some engineering efforts in this direction as I already have a general workflow tool that could help and which is currently being tested together with the prometheus project to address similar issues. NB: @liggitt I got told by @bcmills that you'd be the right person to contact in this regard given your close involvement in the initial migration of k8s to Go modules. |
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. |
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. |
v1.18.0-beta.0 introduces an API change in the generated client-go code where
ctx
is required now as the first parameter. As a mitigation strategy adeprecated
client has been created for people unable/unwilling to change to the new API. This works fine for code that one controls, but it does not work for transitive dependencies. Is there a strategy to handle transitive dependencies that are expecting the old style of API? I'm not sure how to deal with this short of forking all dependencies. Has this scenario been considered?The text was updated successfully, but these errors were encountered: