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

HMC and velero controller-runtime versions are incompatible #794

Open
zerospiel opened this issue Dec 13, 2024 · 5 comments
Open

HMC and velero controller-runtime versions are incompatible #794

zerospiel opened this issue Dec 13, 2024 · 5 comments

Comments

@zerospiel
Copy link
Member

zerospiel commented Dec 13, 2024

Context
The github.com/Mirantis/hmc module currently has sigs.k8s.io/[email protected] direct dependency along with the github.com/vmware-tanzu/[email protected], the latter utilizes sigs.k8s.io/[email protected].

Problem
These two versions of the CR have breaking changes hence importing any packages except API-related is not possible because the dependency tree cannot be resolved due to the aforementioned changes. To be precise the following are the errors produced during the go build of the hmc binary:

# github.com/vmware-tanzu/velero/pkg/util/kube
../../../../pkg/mod/github.com/vmware-tanzu/[email protected]/pkg/util/kube/event_handler.go:34:9: cannot use &enqueueRequestsFromMapFunc{…} (value of type *enqueueRequestsFromMapFunc) as handler.TypedEventHandler["sigs.k8s.io/controller-runtime/pkg/client".Object, reconcile.Request] value in return statement: *enqueueRequestsFromMapFunc does not implement handler.TypedEventHandler["sigs.k8s.io/controller-runtime/pkg/client".Object, reconcile.Request] (wrong type for method Create)
                have Create(context.Context, event.TypedCreateEvent["sigs.k8s.io/controller-runtime/pkg/client".Object], workqueue.RateLimitingInterface)
                want Create(context.Context, event.TypedCreateEvent["sigs.k8s.io/controller-runtime/pkg/client".Object], workqueue.TypedRateLimitingInterface[reconcile.Request])
../../../../pkg/mod/github.com/vmware-tanzu/[email protected]/pkg/util/kube/event_handler.go:39:30: cannot use &enqueueRequestsFromMapFunc{} (value of type *enqueueRequestsFromMapFunc) as handler.TypedEventHandler["sigs.k8s.io/controller-runtime/pkg/client".Object, reconcile.Request] value in variable declaration: *enqueueRequestsFromMapFunc does not implement handler.TypedEventHandler["sigs.k8s.io/controller-runtime/pkg/client".Object, reconcile.Request] (wrong type for method Create)
                have Create(context.Context, event.TypedCreateEvent["sigs.k8s.io/controller-runtime/pkg/client".Object], workqueue.RateLimitingInterface)
                want Create(context.Context, event.TypedCreateEvent["sigs.k8s.io/controller-runtime/pkg/client".Object], workqueue.TypedRateLimitingInterface[reconcile.Request])

Resolution/DOD
The CR version in velero should be bumped at least to 0.19.0 (higher is better), and change the current implementation of the event handler here according to the updated interface in the CR.

After bumping the minimal requirement, we have to bump velero module at least to the development branch, and waiting until a new tag has the updated CR version would be much better.

@s3rj1k
Copy link
Contributor

s3rj1k commented Dec 13, 2024

Before any action can be taken for upstream, we should verify that bumping sigs.k8s.io/controller-runtime to v0.19.x does not break expected compatibility-matrix https://github.com/vmware-tanzu/velero?tab=readme-ov-file#velero-compatibility-matrix, meaning for v1.15 it is expected that Kubernetes versions from 1.18 till latest are operational.

@s3rj1k
Copy link
Contributor

s3rj1k commented Dec 13, 2024

Related change by @zerospiel zerospiel/velero@5818629

@zerospiel
Copy link
Member Author

Just to note: the aforementioned change is a kludge to make it work in the fork, nothing more, the actual implementation should contain generics

@s3rj1k
Copy link
Contributor

s3rj1k commented Dec 13, 2024

Community page: https://velero.io/community/

@s3rj1k
Copy link
Contributor

s3rj1k commented Dec 14, 2024

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

No branches or pull requests

2 participants