-
Notifications
You must be signed in to change notification settings - Fork 858
Closed
Labels
kind/cleanupRefactoring code, fixing up documentation, etcRefactoring code, fixing up documentation, etc
Description
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
Kubernetes supported by Agones. Find thego.mod
file 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.mod
file 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.PATCH
version determined the in
the previous step.
Steps to upgrade Golang version and dependencies:
-
Update
go.mod
andgo.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
build
directory.- 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
golang
version for filebuild/agones-bot/Dockerfile
to <NEW_GOLANG_VERSION_WITHOUT_PATCH>
- At the root directory, run:
-
Update the Dockerfiles for
test
directory.- 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
examples
directory. 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
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>
-
-
Update Golang dependencies in all
go.mod
files:- At the root directory, run:
find . -name 'go.mod' -not -path '*/\.*' -execdir go get -u \;
- At the root directory, run:
-
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
Metadata
Metadata
Assignees
Labels
kind/cleanupRefactoring code, fixing up documentation, etcRefactoring code, fixing up documentation, etc