Skip to content
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

k8s.io/client-go/tools/cache .ResourceEventHandlerRegistration (missing method HasSynced) #1245

Closed
emmajiafan opened this issue Apr 26, 2023 · 3 comments

Comments

@emmajiafan
Copy link

emmajiafan commented Apr 26, 2023

operator-framework/operator-sdk#6396

go fmt ./...
go vet ./...
# sigs.k8s.io/controller-runtime/pkg/cache
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/multi_namespace_cache.go:308:9: cannot use handles (variable of type map[string]"k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration) as "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration value in return statement: map[string]"k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration does not implement "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration (missing method HasSynced)
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/multi_namespace_cache.go:321:9: cannot use handles (variable of type map[string]"k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration) as "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration value in return statement: map[string]"k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration does not implement "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration (missing method HasSynced)
../../../go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/multi_namespace_cache.go:326:17: impossible type assertion: h.(map[string]toolscache.ResourceEventHandlerRegistration)
        map[string]"k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration does not implement "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration (missing method HasSynced)
make: *** [Makefile:110: vet] Error 1

.ResourceEventHandlerRegistration does not implement "k8s.io/client-go/tools/cache".ResourceEventHandlerRegistration (missing method HasSynced)

This problem occurs after update the client-go to " >= v0.27.0".
The type ResourceEventHandlerRegistration is added to client-go from v0.26.0. But it is different with 0.27.0.

0.26.0:
type ResourceEventHandlerRegistration interface{}
0.26.4
type ResourceEventHandlerRegistration interface{}
0.27.0

type ResourceEventHandlerRegistration interface {
	// HasSynced reports if both the parent has synced and all pre-sync
	// events have been delivered.
	HasSynced() [bool](https://pkg.go.dev/builtin#bool)
}
@emmajiafan
Copy link
Author

meet the same problem here: openshift/ingress-node-firewall#334

@liggitt
Copy link
Member

liggitt commented Apr 26, 2023

I think you need to update controller-runtime to a version that includes kubernetes-sigs/controller-runtime#2223 before updating to client-go 0.27.0 (which may mean controller-runtime needs to tag a version that includes that)

@liggitt liggitt closed this as completed Apr 26, 2023
@emmajiafan
Copy link
Author

@liggitt Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants