-
Notifications
You must be signed in to change notification settings - Fork 866
Description
Update Golang to go1.25.0 (released 2025-08-12) and update dependencies.
Steps to determine the Golang version to upgrade to:
- Go to the Kubernetes repository and find the release branch for the most recent version of
Kuberntes supported by Agones. Find thego.modfile in that branch, and look for the go
version. This is the minor version that Agones should use. For instance, if the most recent
Kubernetes version supported by Agones is 1.32, then the minor version of Golang on Agones
should be 1.23 as is determined by thego.modfile in the release branch of Kubernetes
1.32. - Check the Golang release history for the most recent patch
version of the minor version as determined in the previous step. - Update this issue title to reflect the Golang
MAJOR.MINOR.PATCHversion determined the in
the previous step.
Steps to upgrade Golang version and dependencies:
-
Update
go.modandgo.sum. At the root (agones) 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
builddirectory.- At the root 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
golangversion for filebuild/agones-bot/Dockerfiletogolang:<NEW_GOLANG_VERSION_WITHOUT_PATCH>
- At the root directory, run:
-
Update the Dockerfiles for
testdirectory.- At the root directory, run:
find test -type f -exec sed -i 's/golang:[0-9]\+\.[0-9]\+\.[0-9]\+/golang:<NEW_GOLANG_VERSION>/g' {} \; - At the root directory, run:
find test -type f -exec sed -i 's/go [0-9]\+\.[0-9]\+\.[0-9]\+/go <NEW_GOLANG_VERSION>/g' {} \; - At the root directory, run:
find test -type f -name 'go.mod' -execdir go mod tidy \;
- At the root directory, run:
-
Update the Dockerfiles for
examplesdirectory. At the root 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
builddirectory, 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>
-
-
Update Golang dependencies in all
go.modfiles:- At the root directory, run:
find . -name 'go.mod' -not -path '*/\.*' -execdir go get -u \; - At the root directory, run:
find . -name 'go.mod' -not -path '*/\.*' -execdir go mod tidy \;
- At the root directory, run:
-
Run
go mod vendorto ensure all modules are properly updated. -
In the
builddirectory, runmake lintto verify code style and linting rules. -
In the
builddirectory, runmake testto ensure all tests pass. -
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
- In
-
Create a PR for the above changes and send for review
-
Merge the above PR after it is approved