-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Undefined SwitchMetric Error with client-go 0.30.0 in Go Vet #2788
Comments
Controller-runtime v0.17.3 is using client-go 0.29. Sometimes it's impossible for us to be compatible with multiple client-go versions at the same time. IIRC this is such a case. So I think the only options are:
|
Thank you for the quick response and the clarification. I appreciate the guidance on compatible versions. I wasn't aware that client-go had updated so recently. Thanks again for your support! |
You're welcome. The general pattern at the moment is that we have a 1:1 mapping between controller-runtime and client-go (i.e. at least 1 controller-runtime release for every client-go release) We try to stay as compatible as possible with other client-go versions but that is not always possible. It largely depends on if there are breaking changes in client-go and what these are (i.e. if they can be mitigated). There is now also a PR in k/k: kubernetes/kubernetes#124372. Depending on the outcome it could be that client-go v0.30.1+ will be compatible with CR v0.17 again. |
I have upgraded my operator code to adopt K8s v0.30 this week and seeing this issue. When are we planning to release v0.18 with this adoption ? |
Current plan was this week. Related Slack thread: https://kubernetes.slack.com/archives/C02MRBMN00Z/p1713510019996969 nit: I don't think this is a bug in controller-runtime, rather a breaking change in client-go |
Thanks for actively working on this. Sorry, I have fixed my comments. Looking forward to the new release. |
Thank you for the quick fix and release. |
@alvaroaleman should we close this or wait if there's something that we should do after kubernetes/kubernetes#124372 merges? I lean towards there's probably nothing we can do. But we can wait a bit and see what happens to the k/k PR. I suspect it might make client-go 0.30.x compatible with CR v0.17. But given that we don't have any testing I wouldn't try to make CR v0.18 compatible with client-go 0.29 |
Yeah, realistically we have a 1:1 mapping between the two, as there is no testing for skew, we can not promise that it will work anyways. |
- Upgraded to latest hive api from mce-2.7 branch - Upgraded to go 1.22 - Changed code due to changes in the behaviour of runtime-controller library - remove unncessary dependencies from go.mod See related issues on changes for runtime-controller that needed to be addressed: - kubernetes-sigs/controller-runtime#2788 - kubernetes-sigs/controller-runtime#1517
- Upgraded to latest hive api from mce-2.7 branch - Upgraded to go 1.22 - Changed code due to changes in the behaviour of runtime-controller library - remove unncessary dependencies from go.mod See related issues on changes for runtime-controller that needed to be addressed: - kubernetes-sigs/controller-runtime#2788 - kubernetes-sigs/controller-runtime#1517
- Upgraded to latest hive api from mce-2.7 branch - Upgraded to go 1.22 - Changed code due to changes in the behaviour of runtime-controller library - remove unncessary dependencies from go.mod See related issues on changes for runtime-controller that needed to be addressed: - kubernetes-sigs/controller-runtime#2788 - kubernetes-sigs/controller-runtime#1517 Signed-off-by: David Huynh <dhuynh@redhat.com>
- Upgraded to latest hive api from mce-2.7 branch - Upgraded to go 1.22 - Changed code due to changes in the behaviour of runtime-controller library - remove unncessary dependencies from go.mod See related issues on changes for runtime-controller that needed to be addressed: - kubernetes-sigs/controller-runtime#2788 - kubernetes-sigs/controller-runtime#1517 Signed-off-by: David Huynh <dhuynh@redhat.com>
I recently updated to client-go version 0.30.0 while developing a Kubernetes controller using the Operator SDK. When running
go vet ./...
on my project, the following error occurred, suggesting an issue with the controller-runtime package:Go Version
go version go1.22.2 darwin/amd64
OS
MacOS 14.4.1
The text was updated successfully, but these errors were encountered: