-
Notifications
You must be signed in to change notification settings - Fork 332
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
Kubernetes 1.26/1.27 support #2725
Comments
Hey - we're still targeting v1.24 as per our release schedule. We'll be moving to v1.25 in the next few weeks.
So these dynamic wrapped clients were introduced here - #2210 But they're a bit of a headache as you encountered because the codegen/interface need to be updated. Since Knative isn't actually using this functionality I'm thinking we just purge this from cc @pierDipi |
Anything that relies on knative.dev/pkg and has a transitive dependency using k8s 1.26+ will break because we aren't including the new k8s client interfaces (regardless if they're being used). Because of Go's minimum version selection this is getting harder to avoid as more dependencies update. 😢 Not looking to bump the minimum supported server version - I'm looking to add support for the new k8s client interface definition so the injection client can be forwards compatible.
This is for the typed k8s client, which looks like has usage across knative. I don't think the dynamic client is affected by this. |
I see what you're saying now about the dynamic client - it's because that's what the wrapClient is used for. An idea - what if we modify the codegen to do this: type wrapClient struct {
+ kubernetes.Interface
dyn dynamic.Interface
}
- var _ kubernetes.Interface = (*wrapClient)(nil) This would let the client satisfy newer interface versions, even if Go mod used a newer client version. This has a downside of if you tried to access a newer client API then what knative supports it will panic, but we're already allowing panics for Discovery endpoints and as long as you're using existing API versions you shouldn't see a difference. wdyt? 🤔 |
The additional methods called |
The downside is that instead of having a NYI panic, we will get a |
Played around with this a bit - the codegen wasn't working for me because the repo wasn't on GOPATH. The interface embedding isn't going to work because it will still fail for interfaces that were removed in newer k8s client versions (I ran into issues with the deprecated PodSecurityPolicy interface since it was removed in newer versions). |
Expected Behavior
I should be able to use knative.dev/pkg with Kubernetes 1.26 and 1.27 libraries.
Actual Behavior
Cannot build because the injection interface is missing the new AdmissionregistrationV1alpha1 client added in 1.26:
Steps to Reproduce the Problem
Use latest knative.dev/pkg + k8s.io/client-go v0.26 or v0.27:
go.mod
Additional Info
I took a stab at updating k8s.io/* packages to v0.27.0, but I got stuck because
./hack/update-codegen
wasn't picking up theAdmissionregistrationV1alpha1
client for the injection clients (despite stdout saying it was being recognized). If anyone has ideas lmk!The text was updated successfully, but these errors were encountered: