-
Notifications
You must be signed in to change notification settings - Fork 1
fix: go build failing
#2
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
base: main
Are you sure you want to change the base?
Conversation
- go build is still failing but the error is in our code now
- controller-runtime and cluster-api versions were bumped - new version of controller-runtime has a lot of breaking changes
| k8s.io/klog/v2 v2.90.1 | ||
| k8s.io/utils v0.0.0-20230209194617-a36077c30491 | ||
| sigs.k8s.io/cluster-api v1.4.1 | ||
| sigs.k8s.io/controller-runtime v0.14.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would throw the following error

Updating controller-runtime to v0.15.0 fixes the above issue but creates another problem. There's a bunch of breaking changes in v0.15.0 which cluster-api has addressed in v1.5.0-beta.0. Any lower version of cluster-api and go build fails.
|
|
||
| if err = c.Watch( | ||
| &source.Kind{Type: &clusterv1.Cluster{}}, | ||
| source.Kind(mgr.GetCache(), &clusterv1.Cluster{}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source.Kind is a function in v0.15.0 version of controller-runtime.
|
|
||
| func (r *KwokControlPlaneReconciler) kwokClusterToKwokControlPlane(ctx context.Context, logger *logr.Logger) handler.MapFunc { | ||
| return func(o client.Object) []ctrl.Request { | ||
| return func(ctx context.Context, o client.Object) []ctrl.Request { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix syntax error. handler.MapFunc expects first argument to the function to be of type context.Context
// MapFunc is the signature required for enqueueing requests from a generic function.
// This type is usually used with EnqueueRequestsFromMapFunc when registering an event handler.
type MapFunc func(context.Context, client.Object) []reconcile.Request| k8s.io/utils v0.0.0-20230209194617-a36077c30491 | ||
| sigs.k8s.io/cluster-api v1.4.1 | ||
| sigs.k8s.io/controller-runtime v0.14.5 | ||
| sigs.k8s.io/cluster-api v1.5.0-beta.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only changed
sigs.k8s.io/cluster-api v1.5.0-beta.0
sigs.k8s.io/controller-runtime v0.15.0
Rest of the changes are a result of doing go mod tidy

I was trying out the project on my local machine but
go buildwas failing. This PR fixes it.