-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
go/types: sigs.k8s.io/controller-tools/cmd/controller-gen crashes on 1.22 #65637
Comments
Indeed, this looks like a breakage due to the change in #61035. A number of tools broke that were relying on undocumented behavior of From kubernetes-sigs/controller-tools#880 this appears to have been fixed downstream. In that case, I'm not sure there's anything more we can do. |
go run sigs.k8s.io/controller-tools/cmd/controller-gen
crashes on Go 1.22This fixes panic on go1.22, see kubernetes-sigs/controller-tools#880 and golang/go#65637 Since `go get sigs.k8s.io/controller-tools` updates transitive Kubernetes dependencies this change removes it from dependencies in favor of fixed version in the Makefile. Signed-off-by: Alexander Yastrebov <[email protected]>
Why is golang doing breaking changes in minor releases? Reserve these for major releases please. Something being undocumented is no excuse, it's still part of the API contract. |
I don't see why it's part of the API contract. Those clients are assuming wrong thing, which |
@findleyr Sorry for the dumb question, but what is the undocumented behavior that changed? I don't understand how we get a |
@ianlancetaylor prior to https://go.dev/cl/516917, go/packages would set a nil I don't think I tracked down exactly what happened in this particular case: I've seen that stack many times, and assumed it followed the same pattern. Here's another example: google/wire#400 There are several lessons to be learned here. |
That makes it sound like the fix is for controller-gen to update to a newer version of golang.org/x/tools. If that is so it seems OK, though hardly ideal, for an upgrade to a new version of Go to require an upgrade to newer versions of supporting packages. |
My motivation for raising this is that we're currently not in a position where we can update |
The change does not break the documented API. And there is a straightforward workaround that doesn't involve changing any code. This change is permitted by our backward compatibility guidelines (https://go.dev/doc/go1compat). I agree of course that this case is not ideal, and we would have avoided it if it were possible. But it wasn't. It's not clear to me why it is OK for you to update to a new version of Go but it is not OK to update to a new version of golang.org/x/tools. I'm going to close this issue because while it is unfortunate I don't think there is anything we can do. Please comment if you disagree. |
The problem is that |
You should be able to |
Yeah that will help if the dependency is pictured in |
#48429 will make this easier, but you could use the //go:build tools
package tools
import (
"github.com/go-swagger/go-swagger/cmd/swagger"
) Then run without a version number: $ go run github.com/go-swagger/go-swagger/cmd/swagger |
Yeah, I'm waiting for something like #48429 as that workaround with the go file seems too "dirty" 😆. But yes, it's good to have this option in worst case. |
I didn't quite realize that updating |
Fix a nil pointer issue after bumping up to go1.22 More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
Fix a nil pointer issue after bumping up to go1.22 More details see golang/go#65637 Also update the way protoc is called, more details see: golang/protobuf#1070 Signed-off-by: Daniel Jiang <[email protected]>
Fix a nil pointer issue after bumping up to go1.22 More details see golang/go#65637 Also update the way protoc is called, more details see: golang/protobuf#1070 Signed-off-by: Daniel Jiang <[email protected]>
Bump up controller-gen to v0.14.0 to fix a nil pointer issue after bumping up to go1.22 More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
This commit bumps up the golang for building and testing velero to v1.22 It also updates controller-gen to v0.14.0 to fix an issue under new versino of go. More details see golang/go#65637 Signed-off-by: Daniel Jiang <[email protected]>
Go version
go version go1.22.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Run
sigs.k8s.io/controller-tools
built with go1.22:How to replicate:
git clone https://github.com/zalando-incubator/stackset-controller.git cd stackset-controller go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1,allowDangerousTypes=true paths=./pkg/apis/... output:crd:dir=docs
Also reported here by other users: kubernetes-sigs/controller-tools#880
What did you see happen?
The command:
crashes with:
What did you expect to see?
With
go1.21.7
there is no panic.I have bisected between
go1.21.7
andgo.1.22.0
and found this commit to cause the issue: 5fa4aacThe text was updated successfully, but these errors were encountered: