What happened:
In a golang project using go modules (the default as of current golang versions), upgrading the go.mod file to use the latest version of k8s.io/apimachinery (v0.31.0) in a project importing agones.dev/agones causes
go/pkg/mod/agones.dev/agones@v1.43.0/pkg/util/runtime/runtime.go:50:29: cannot use func(err error) {…} (value of type func(err error)) as "k8s.io/apimachinery/pkg/util/runtime".ErrorHandler value in assignment
What you expected to happen:
Not particularly unexpected, as this isn't the k8s apimachinery version agones supports at its current release (the agones go.mod file specifies k8s.io/apimachinery v0.29.7). This issue is just for tracking and to document steps to fix this for others who encounter the issue until a new release of agones that supports k8s apimachinery >- v0.31.0 is cut. Basically just want folks who encounter this to be able to search for it in the github issues and see this.
How to reproduce it (as minimally and precisely as possible):
In a golang project that specifies both k8s.io/apimachinery and agones.dev/agones as direct dependencies, run
go get -u ./... # this upgrades k8s.io/apimachinery to latest, so don't do it
go mod tidy # modifies the go.mod file to use the latest version of k8s.io/apimachinery
go build <project>
Anything else we need to know?:
If you have this issue when trying to go build your golang project, these steps should help resolve it:
go get k8s.io/apimachinery@v0.29.7 # force local go environment package directory to downgrade to agones-compatible version
go mod tidy
What happened: In a golang project using go modules (the default as of current golang versions), upgrading the go.mod file to use the latest version of
k8s.io/apimachinery
(v0.31.0) in a project importingagones.dev/agones
causesWhat you expected to happen: Not particularly unexpected, as this isn't the k8s apimachinery version agones supports at its current release (the agones go.mod file specifies
k8s.io/apimachinery v0.29.7
). This issue is just for tracking and to document steps to fix this for others who encounter the issue until a new release of agones that supports k8s apimachinery >- v0.31.0 is cut. Basically just want folks who encounter this to be able to search for it in the github issues and see this.How to reproduce it (as minimally and precisely as possible): In a golang project that specifies both
k8s.io/apimachinery
andagones.dev/agones
as direct dependencies, runAnything else we need to know?: If you have this issue when trying to
go build
your golang project, these steps should help resolve it:Environment:
kubectl version
): N/A