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

Controller-runtime does not compile with client-go 1.31 with version v0.18.5 #2925

Closed
howardjohn opened this issue Aug 13, 2024 · 17 comments
Closed

Comments

@howardjohn
Copy link
Contributor

Reproducer:

main.go:

package main

import (
        _ "k8s.io/client-go"
        _ "sigs.k8s.io/controller-runtime/pkg/client/fake"
)

func main() {
}

go.mod:

module test

go 1.22.6

require sigs.k8s.io/controller-runtime v0.18.5

require k8s.io/client-go v0.31.0

Gives:

$ go build .
# sigs.k8s.io/controller-runtime/pkg/client/fake
/home/john/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.5/pkg/client/fake/client.go:858:29: cannot use c.tracker (variable of type versionedTracker) as "k8s.io/client-go/testing".ObjectTracker value in argument to dryPatch: versionedTracker does not implement "k8s.io/client-go/testing".ObjectTracker (wrong type for method Create)
                have Create("k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource, "k8s.io/apimachinery/pkg/runtime".Object, string) error
                want Create("k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource, "k8s.io/apimachinery/pkg/runtime".Object, string, ..."k8s.io/apimachinery/pkg/apis/meta/v1".CreateOptions) error
/home/john/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.5/pkg/client/fake/client.go:872:37: cannot use c.tracker (variable of type versionedTracker) as "k8s.io/client-go/testing".ObjectTracker value in argument to testing.ObjectReaction: versionedTracker does not implement "k8s.io/client-go/testing".ObjectTracker (wrong type for method Create)
                have Create("k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource, "k8s.io/apimachinery/pkg/runtime".Object, string) error
                want Create("k8s.io/apimachinery/pkg/runtime/schema".GroupVersionResource, "k8s.io/apimachinery/pkg/runtime".Object, string, ..."k8s.io/apimachinery/pkg/apis/meta/v1".CreateOptions) error
@howardjohn
Copy link
Contributor Author

Broken by kubernetes/kubernetes#125560

@howardjohn
Copy link
Contributor Author

In the past sometimes we have done tricks to support both versions concurrently. I don't see how we can do it in this case

@howardjohn howardjohn changed the title Does not compile with Go 1.31 Does not compile with client-go 1.31 Aug 13, 2024
@dims
Copy link
Member

dims commented Aug 13, 2024

cc @jpbetz @liggitt

@danielvegamyhre
Copy link

I am impacted by this as well.

@sbueringer
Copy link
Member

While this is not great, it is not something that we guarantee to support, see: https://github.com/kubernetes-sigs/controller-runtime#compatibility

@jpbetz
Copy link

jpbetz commented Aug 13, 2024

Can anyone impacted verify that if they upgrade client-go into the supported skew range that the problem is resolved?

@howardjohn
Copy link
Contributor Author

Ah I looked for a newer CR release but didn't see it since where I was looking filtered out 0.19 due to the -beta suffix. At least in my example reproducer that does seem to compile.

@sbueringer
Copy link
Member

sbueringer commented Aug 13, 2024

Ah, makes sense! Yup 0.19 would be the correct release for k8s.io/* 1.31.0

I think we'll release it soon. Last thing we want to get done before is this one: #2901 (at least as far as I'm aware)

@sbueringer
Copy link
Member

@dims
Copy link
Member

dims commented Aug 13, 2024

I think we'll release it soon.

thanks @sbueringer !

@davidkarlsen
Copy link

@liggitt
Copy link

liggitt commented Aug 17, 2024

Hm, when I use 0.19, I get this problem: https://github.com/davidkarlsen/flyway-operator/actions/runs/10406586858/job/28819954478

that CI run is still referencing 0.29.0 versions of some kubernetes libraries, I think there's a version mismatch there or they have not all been bumped to 0.31.0 consistently

go: downloading k8s.io/apiextensions-apiserver v0.29.0
go: downloading k8s.io/apimachinery v0.29.0

@davidkarlsen
Copy link

I figured out it was my controller-gen tooling being outdated.

@troy0820
Copy link
Member

/retitle Controller-runtime does not compile with client-go 1.31 with version v0.18.5

Do we still need this open? I believe we released v0.19.0 and it works along with the table @sbueringer created on the README.

@k8s-ci-robot k8s-ci-robot changed the title Does not compile with client-go 1.31 Controller-runtime does not compile with client-go 1.31 with version v0.18.5 Aug 19, 2024
@howardjohn
Copy link
Contributor Author

From my POV good to close

@troy0820
Copy link
Member

/close

@k8s-ci-robot
Copy link
Contributor

@troy0820: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

9 participants