-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
AddEventHandler return type error #2302
Comments
Which versions of controller-runtime and client-go are you using? |
k8s.io/client-go v0.26.3 I feel this error is reasonable. it declare to return toolscache.ResourceEventHandlerRegistration, but return map[string]toolscache.ResourceEventHandlerRegistration |
ResourceEventHandlerRegistration doesn't have a HasSynced func in client-go v0.26.3 https://github.com/kubernetes/client-go/blob/v0.26.3/tools/cache/shared_informer.go#L213-L216 This was introduced in v0.27.x https://github.com/kubernetes/client-go/blob/v0.27.1/tools/cache/shared_informer.go#L217-L227 Based on that I assume that somehow client-go v0.27 is used |
Thank you for response. I had checked . it used v0.27.x |
Hi there, ran into the same issue. In my case i used the latest client-go and controller controller-runtime
Potential fix of pinning everything to v0.26.4 did the trick trick for now.
|
Not sure why those replace statements are needed, that's probably specific to your case. We are just having them as normal dependencies (https://github.com/kubernetes-sigs/cluster-api/blob/main/go.mod#L35-L45) and go mod tidy etc. don' try to bump |
Thanks @sbueringer ! Do you want to consider supporting k8s.io/client-go v0.27.x going forward? Otherwise I will always be stuck on this version for k8s api if I was to include this library in my project. |
The main branch already supports it. Next release is currently planned for next week. In general we create corresponding CR releases after Kubernetes releases. This time we had to wait for a fix in 0.27.2 |
@sbueringer it still happening on 0.27.6. |
Without more context it's had to tell what is going wrong. What I can do is provide an example. In Cluster API v1.5.x we use controller-runtime v0.15.3 with client-go v0.27.7 without any issues. To be clear. At the time we were only waiting for v0.27.2 to release controller-runtime v0.15.0. v0.27.2 wasn't supposed to (and didn't) make client-go compatible with controller-runtime v0.14.x. |
I check the code , It feels like a mistake
The text was updated successfully, but these errors were encountered: