Issue while updating upjet to 1.4.2 (crossplane-runtime v1.18.0)
What happened?
I was trying to update upjet to v1.4.2 and stumbled upon the following error:
github.com/crossplane/upjet/pkg/controller/handler
# github.com/crossplane/upjet/pkg/controller/handler
../../go/pkg/mod/github.com/crossplane/[email protected]/pkg/controller/handler/eventhandler.go:114:33: cannot use limitingInterface (variable of type workqueue.RateLimitingInterface) as workqueue.TypedRateLimitingInterface[reconcile.Request] value in argument to e.innerHandler.Create: workqueue.RateLimitingInterface does not implement workqueue.TypedRateLimitingInterface[reconcile.Request] (wrong type for method Add)
have Add(any)
want Add(reconcile.Request)
../../go/pkg/mod/github.com/crossplane/[email protected]/pkg/controller/handler/eventhandler.go:120:33: cannot use limitingInterface (variable of type workqueue.RateLimitingInterface) as workqueue.TypedRateLimitingInterface[reconcile.Request] value in argument to e.innerHandler.Update: workqueue.RateLimitingInterface does not implement workqueue.TypedRateLimitingInterface[reconcile.Request] (wrong type for method Add)
have Add(any)
want Add(reconcile.Request)
../../go/pkg/mod/github.com/crossplane/[email protected]/pkg/controller/handler/eventhandler.go:126:33: cannot use limitingInterface (variable of type workqueue.RateLimitingInterface) as workqueue.TypedRateLimitingInterface[reconcile.Request] value in argument to e.innerHandler.Delete: workqueue.RateLimitingInterface does not implement workqueue.TypedRateLimitingInterface[reconcile.Request] (wrong type for method Add)
have Add(any)
want Add(reconcile.Request)
../../go/pkg/mod/github.com/crossplane/[email protected]/pkg/controller/handler/eventhandler.go:132:34: cannot use limitingInterface (variable of type workqueue.RateLimitingInterface) as workqueue.TypedRateLimitingInterface[reconcile.Request] value in argument to e.innerHandler.Generic: workqueue.RateLimitingInterface does not implement workqueue.TypedRateLimitingInterface[reconcile.Request] (wrong type for method Add)
have Add(any)
want Add(reconcile.Request)
How can we reproduce it?
You can checkout my branch and try to run a make build: https://github.com/scaleway/crossplane-provider-scaleway/pull/123
Try controller-runtime 0.18, see breaking changes in 0.19 here: https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.19.0
I've tried and it still give me the same error :/ beside doing a go mod tidy revert this change :/
This seems to work, you also need to use k8s 0.30 and controller-tools v0.14.0
require (
dario.cat/mergo v1.0.1
github.com/alecthomas/kingpin/v2 v2.4.0
github.com/crossplane/crossplane-runtime v1.17.0
github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79
github.com/crossplane/upjet v1.4.1-0.20250130134024-ce71033d450f
github.com/pkg/errors v0.9.1
k8s.io/apimachinery v0.30.0
k8s.io/client-go v0.30.0
sigs.k8s.io/controller-runtime v0.18.2
sigs.k8s.io/controller-tools v0.14.0
)
It looks like 0.31/0.18/1.18 will be supported by #452
Looks like this is covered by https://github.com/crossplane/upjet/pull/458