agones.dev/agones@v1.53.0/.github/ISSUE_TEMPLATE/golang_version_upgrade.md (about) 1 --- 2 name: Golang Version and Dependency Upgrades 3 about: Steps to upgrade Golang version and dependencies 4 title: "Golang MAJOR.MINOR.PATCH Version and Dependency Upgrades" 5 labels: kind/cleanup 6 assignees: "" 7 --- 8 9 Steps to determine the Golang version to upgrade to: 10 11 - [ ] Go to the Kubernetes repository and find the release branch for the most recent version of 12 Kuberntes supported by Agones. Find the `go.mod` file in that branch, and look for the go 13 version. This is the minor version that Agones should use. For instance, if the most recent 14 Kubernetes version supported by Agones is 1.32, then the minor version of Golang on Agones 15 should be 1.23 as is determined by the `go.mod` file in the [release branch of Kubernetes 16 1.32](https://github.com/kubernetes/kubernetes/blob/release-1.32/go.mod#L9). 17 - [ ] Check the [Golang release history](https://go.dev/doc/devel/release) for the most recent patch 18 version of the minor version as determined in the previous step. 19 - [ ] Update this issue title to reflect the Golang `MAJOR.MINOR.PATCH` version determined the in 20 the previous step. 21 22 Steps to upgrade Golang version and dependencies: 23 24 - [ ] Update `go.mod` and `go.sum`. At the root (agones) directory, run: 25 26 - [ ] `find . -name 'go.mod' -not -path '*/\.*' -execdir go mod edit -go=<NEW_GOLANG_VERSION_WITHOUT_PATCH> \;` 27 - [ ] `find . -name 'go.mod' -not -path '*/\.*' -execdir go mod tidy \;` 28 29 - [ ] Update the Dockerfiles for `build` directory. 30 31 - [ ] 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' {} \;` 32 - [ ] Update the `golang` version for file `build/agones-bot/Dockerfile` to `golang:<NEW_GOLANG_VERSION_WITHOUT_PATCH>` 33 34 - [ ] Update the Dockerfiles for `test` directory. 35 36 - [ ] 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' {} \;` 37 - [ ] 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' {} \;` 38 - [ ] At the root directory, run: `find test -type f -name 'go.mod' -execdir go mod tidy \;` 39 40 - [ ] Update the Dockerfiles for `examples` directory. At the root directory, run: 41 42 - [ ] `find examples -name Dockerfile -exec sed -i 's/golang:[0-9]\+\.[0-9]\+-alpine/golang:<NEW_GOLANG_VERSION_WITHOUT_PATCH>-alpine/g' {} \;` 43 - [ ] `find examples \( -name Dockerfile -o -name Dockerfile.windows \) -exec sed -i 's/golang:[0-9]\+\.[0-9]\+\.[0-9]\+/golang:<NEW_GOLANG_VERSION>/g' {} \;` 44 45 - [ ] Update the example images tag. At `build` directory, run: 46 47 - [ ] `make bump-image IMAGENAME=allocation-endpoint-proxy VERSION=<current-image-version>` 48 - [ ] `make bump-image IMAGENAME=autoscaler-webhook VERSION=<current-image-version>` 49 - [ ] `make bump-image IMAGENAME=crd-client VERSION=<current-image-version>` 50 - [ ] `make bump-image IMAGENAME=custom-controller VERSION=<current-image-version>` 51 - [ ] `make bump-image IMAGENAME=simple-game-server VERSION=<current-image-version>` 52 - [ ] `make bump-image IMAGENAME=simple-genai-game-server VERSION=<current-image-version>` 53 - [ ] `make bump-image IMAGENAME=supertuxkart-example VERSION=<current-image-version>` 54 - [ ] `make bump-image IMAGENAME=xonotic-example VERSION=<current-image-version>` 55 56 - [ ] Update Golang dependencies in all `go.mod` files: 57 58 - [ ] At the root directory, run: `find . -name 'go.mod' -not -path '*/\.*' -execdir go get -u \;` 59 - [ ] At the root directory, run: `find . -name 'go.mod' -not -path '*/\.*' -execdir go mod tidy \;` 60 61 - [ ] Run `go mod vendor` to ensure all modules are properly updated. 62 - [ ] In the `build` directory, run `make lint` to verify code style and linting rules. 63 - [ ] In the `build` directory, run `make test` to ensure all tests pass. 64 65 - [ ] Run the following to generate and push the new example images: 66 67 - [ ] In `examples/allocation-endpoint`, run: `make cloud-build` 68 - [ ] In `examples/autoscaler-webhook`, run: `make cloud-build` 69 - [ ] In `examples/crd-client`, run: `make cloud-build` 70 - [ ] In `examples/custom-controller`, run: `make cloud-build` 71 - [ ] In `examples/simple-game-server`, run: `make cloud-build` 72 - [ ] In `examples/simple-genai-server`, run: `make cloud-build` 73 - [ ] In `examples/supertuxkart`, run: `make cloud-build` 74 - [ ] In `examples/xonotic`, run: `make cloud-build` 75 76 - [ ] Create a PR for the above changes and send for review 77 78 - [ ] Merge the above PR after it is approved