fix: go build failing#2
Open
vadasambar wants to merge 2 commits into
Open
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
vadasambar
commented
Jun 29, 2023
| 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 |
Author
There was a problem hiding this comment.
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.
vadasambar
commented
Jun 29, 2023
|
|
||
| if err = c.Watch( | ||
| &source.Kind{Type: &clusterv1.Cluster{}}, | ||
| source.Kind(mgr.GetCache(), &clusterv1.Cluster{}), |
Author
There was a problem hiding this comment.
source.Kind is a function in v0.15.0 version of controller-runtime.
vadasambar
commented
Jun 29, 2023
|
|
||
| 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 { |
Author
There was a problem hiding this comment.
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
Author
Author
vadasambar
commented
Jun 29, 2023
| 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 |
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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