Golang Version Upgrades - magma/magma GitHub Wiki

Major version upgrades of Go have been a significant challenge in the past:

This page will give an overview of the necessary steps for such an upgrade.

1. Upload the Go release to Artifactory

Get the target release from https://go.dev/dl/ and upload it to:

Talk to a CI code owner if you don't have permission to upload files.

2. Replace Go version in Docker, Ansible and CI config

All the Go versions in various configuration files for containers and VMs, as well as the CI, need to be replaced by the new version. This includes adapting the SHA-256 checksum in some cases.

There is a script golang_check_version.sh that is run as part of the CI that can be used to find these files. The new target version also needs to be set in the script.

3. Update the Go version in go.mod files

This is only necessary for major version upgrades and can be skipped for minor versions. Set the correct major version in go.mod files, then run go mod tidy in the respective folders.

There are many go.mod files in the repository, so it may be advisable to carry out both of these steps with a script.

4. Fix issues

Fix any issues that were introduced by the upgrade, upgraded libraries, changed APIs, removed deprecations...

5. Run tests

Test the orc8r and its connection to an AGW locally. Also try regenerating all autogenerated files via:

cd $MAGMA_ROOT/orc8r/cloud/docker/
./build.py --generate

Run the Federated Integeration Tests and the CWF Integration Tests.

For major version upgrades of Go, orc8r should also be deployed successfully on minikube, following these instructions.

6. Update the docs

Update the Prerequisites page, as in this pull request, so that users download a consistent version of Go.