Skip to content

go.mod: don't enforce latest go version#351

Merged
BigVan merged 6 commits into
containerd:mainfrom
thaJeztah:min_go_version
Apr 4, 2026
Merged

go.mod: don't enforce latest go version#351
BigVan merged 6 commits into
containerd:mainfrom
thaJeztah:min_go_version

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Commit e9d8229 updated the version of go to use for this module, but also updated the go directive in go.mod, preventing users of this module to use lower versions.

For modules used as library, Go generally recommends supporting at least the current stable and "oldstable" (stable -1) releases.

This patch:

  • downgrades the go directive in go.mod to go1.25
  • updates github actions workflows to test both the specified version (1.26) and the version specified in go.mod (minimal version).

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@BigVan BigVan requested a review from yuchen0cc March 31, 2026 15:22
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

Added two commits;

  • first commit removes the GOPATH handling (repo is a module now, so shouldn't require a specific path
  • third commit switches the tests that are ran as root to only run the tests as root (through go test -exec sudo ), instead of running the make target as root (which runs both make and go as root, so including building the test binaries).

Comment thread .github/workflows/ci-unit-test.yml Fixed
@thaJeztah
Copy link
Copy Markdown
Member Author

Hm.. yeah, CodeQL looks to be correct; probably best to add permissions as well

I also think I should add GOTOOLCHAIN=local to prevent Go from implicitly upgrading Go versions; let me update

Commit e9d8229 updated the version of go to
use for this module, but also updated the go directive in go.mod, preventing
users of this module to use lower versions.

For modules used as library, Go generally recommends supporting at least the
current stable and "oldstable" (stable -1) releases.

This patch:

- downgrades the go directive in go.mod to go1.25
- updates github actions workflows to test both the specified version (1.26)
  and the version specified in go.mod (minimal version).
- sets GOTOOLCHAIN=local to prevent implicit go upgrades

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Avoid running the full `go test` invocation (including build) as root.
Using `-exec sudo` ensures only the test binary is executed with
elevated privileges, while compilation and caching remain unprivileged.

This prevents root-owned build artifacts and aligns better with
module-based workflows, while still allowing tests that require root
(e.g., via `-test.root`) to run correctly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
fail-fast has no effect if there's no matrix (without a matrix it's
always fail-fast).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@BigVan
Copy link
Copy Markdown
Member

BigVan commented Apr 4, 2026

@chewi PTAL :D

@chewi
Copy link
Copy Markdown
Contributor

chewi commented Apr 4, 2026

I'm not familiar with the CI bits, but simply changing go.mod was enough for us.

@BigVan BigVan merged commit 155d50b into containerd:main Apr 4, 2026
7 checks passed
@thaJeztah thaJeztah deleted the min_go_version branch April 4, 2026 15:10
@thaJeztah
Copy link
Copy Markdown
Member Author

Yeah, I noticed as well that the release workflow uses a third-party archived / unmaintained action; probably should be looked at to replace it with something maintained (or the gh CLI, but that can be slightly more "finicky" to set up);

- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
releases/*/overlaybd-snapshotter*
releases/accelerated-container-image-*-vendor.tar.xz

☝️ that action looks to be archived in 2024; https://github.com/marvinpinto/action-automatic-releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants