agones icon indicating copy to clipboard operation
agones copied to clipboard

Upgrade to Golang 1.22.6

Open igooch opened this issue 1 year ago • 1 comments

Steps to upgrade Golang version:

  • [ ] Update go.mod and go.sum. At the root of the directory, run:

    • [ ] find . -name 'go.mod' -not -path '*/\.*' -execdir go mod edit -go=<NEW_GOLANG_VERSION_WITHOUT_PATCH> \;
    • [ ] find . -name 'go.mod' -not -path '*/\.*' -execdir go mod tidy \;
  • [ ] Update the Dockerfiles for build directory. At the root of the directory, run:

    find build -type f \( -not -path '*/\.*' -and -not -path 'build/tmp/*' \) -exec sed -i 's/GO_VERSION=[0-9]\+\.[0-9]\+\.[0-9]\+/GO_VERSION=<NEW_GOLANG_VERSION>/g' {} \;

  • [ ] Update the Dockerfiles for examples directory. At the root of the directory, run:

    • [ ] find examples -name Dockerfile -exec sed -i 's/golang:[0-9]\+\.[0-9]\+-alpine/golang:<NEW_GOLANG_VERSION_WITHOUT_PATCH>-alpine/g' {} \;
    • [ ] find examples \( -name Dockerfile -o -name Dockerfile.windows \) -exec sed -i 's/golang:[0-9]\+\.[0-9]\+\.[0-9]\+/golang:<NEW_GOLANG_VERSION>/g' {} \;
  • [ ] Update the example images tag. At build directory, run:

    • [ ] make bump-image IMAGENAME=allocation-endpoint-proxy VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=autoscaler-webhook VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=crd-client VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=custom-controller VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=simple-game-server VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=simple-genai-game-server VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=supertuxkart-example VERSION=<current-image-version>
    • [ ] make bump-image IMAGENAME=xonotic-example VERSION=<current-image-version>
  • [ ] Create a PR for the above changes and send for review

  • [ ] After the above PR is approved, before merging it, run the following to generate and push the new example images:

    • [ ] In examples/allocation-endpoint, run: make cloud-build
    • [ ] In examples/autoscaler-webhook, run: make cloud-build
    • [ ] In examples/crd-client, run: make cloud-build
    • [ ] In examples/custom-controller, run: make cloud-build
    • [ ] In examples/simple-game-server, run: make cloud-build
    • [ ] In examples/simple-genai-server, run: make cloud-build
    • [ ] In examples/supertuxkart, run: make cloud-build
    • [ ] In examples/xonotic, run: make cloud-build
  • [ ] Merge the above PR

igooch avatar Aug 14 '24 18:08 igooch

A note that there was a change in https://pkg.go.dev/k8s.io/apimachinery/pkg/util/runtime#ErrorHandler, so there will be a build error for 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.

We'll need to change:

https://github.com/googleforgames/agones/blob/3fa5ab740007d176b019f556a4228fb8a1b9faf9/pkg/util/runtime/runtime.go#L50

to use the new parameters:

runtime.ErrorHandlers[0] = func(_ context.Context, err error, _ string, _ ...interface{}) {

and update the associated test.

igooch avatar Aug 15 '24 17:08 igooch

Hi @0xaravindh Please update the Golang version by following steps mention in this template.

ashutosji avatar Sep 12 '24 06:09 ashutosji