Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg_managers: gomod: Fix the Go toolchain selection conditions
When commit d9d1620 enabled full Go 1.21 support the semantics it used for the Go toolchain selection conditions was very unfortunate as it revolved too much around the 'go_max_version' variable which at the time was set to be 1.21. The problem there is that once we try bumping the max version to say 1.22 the conditions stop making sense and as a bonus the existing tests start failing. The reasons for that are the following: - we're not actually planning on updating the container image with each Go version we're going to support unless absolutely necessary; that is thanks to the GOTOOLCHAIN=auto mechanism introduced by 1.21 that will download any new toolchain as needed automatically - without changing unit tests we suddenly can't pass the trivial condition on selecting the old fallback 1.20 if the existing unit test's base Go release is 1.21.X and the new max supported version is 1.22 Tweak the selection conditions so that they finally make sense semantically: - use go_max_version only to check incoming requests for incompatible new releases - otherwise always explicitly compare against 1.21 and only fall back to 1.20 if the base release is above 1.21 which would lead to dirtying the source repo due to compatibility issues on Golang's side Fixes: d9d1620 Signed-off-by: Erik Skultety <eskultet@redhat.com>
- Loading branch information