From ad0177e86d0e3517e96b6cbcff914ea2cfc9b7b8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 4 Dec 2026 18:17:15 +0100 Subject: [PATCH] Decouple Go build version from minimum module requirements Introduce a .go-version file to select the Go toolchain used by the Makefile and CI, instead of deriving it from the minimum Go version specified in go.mod or go.work. Normalize the Go directives to 1.26.0 to avoid unnecessarily requiring a specific patch release for consumers of the modules. This allows updating the Go toolchain used for builds and tests without changing the minimum Go version required by the modules. Leave the existing Dockerfile and Bake defaults unchanged for now. Signed-off-by: Sebastiaan van Stijn --- .github/workflows/fuzz.yml | 2 +- .github/workflows/go-work-check.yml | 2 +- .github/workflows/keychain.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/unittests.yml | 4 ++-- .go-version | 1 + Makefile | 2 +- client/go.mod | 2 +- go.work | 2 +- plugin/go.mod | 2 +- plugins/credentialhelper/go.mod | 2 +- plugins/pass/go.mod | 2 +- store/go.mod | 2 +- vendor/modules.txt | 6 +++--- x/go.mod | 2 +- 15 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .go-version diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 53a778aa..2fc65564 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -28,7 +28,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version # Go stores the corpus it generates under $GOCACHE/fuzz. Restoring the # most recent corpus lets every run build on the interesting inputs # that earlier runs found instead of restarting from the seeds. diff --git a/.github/workflows/go-work-check.yml b/.github/workflows/go-work-check.yml index 1e7bfd9d..22847aa9 100644 --- a/.github/workflows/go-work-check.yml +++ b/.github/workflows/go-work-check.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Check if go work sync/vendor is clean run: |- go work sync diff --git a/.github/workflows/keychain.yml b/.github/workflows/keychain.yml index 25ac15ab..63456ac4 100644 --- a/.github/workflows/keychain.yml +++ b/.github/workflows/keychain.yml @@ -67,7 +67,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Test keychain run: make keychain-unit-tests tests-macos: @@ -88,6 +88,6 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Test keychain run: make keychain-unit-tests diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9d1b687e..e7ba98dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Hub login if: env.IS_TRUSTED == 'true' uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 201d7780..5342c036 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Tests run: make unit-tests @@ -32,7 +32,7 @@ jobs: - name: Setup Go uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: - go-version-file: go.work + go-version-file: .go-version - name: Tests run: go test -trimpath -race -v ./${{ matrix.module }}/... env: diff --git a/.go-version b/.go-version new file mode 100644 index 00000000..fabf6632 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.26.11 diff --git a/Makefile b/Makefile index 9486aada..c8039129 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ GIT_TAG?=dev -GO_VERSION := $(shell sh -c "awk '/^go / { print \$$2 }' go.work") +GO_VERSION := $(shell cat .go-version) # For latest version, see: https://github.com/bufbuild/buf/tags export BUF_VERSION := v1.56.0 diff --git a/client/go.mod b/client/go.mod index 370c0194..5a5c0a64 100644 --- a/client/go.mod +++ b/client/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/client -go 1.26.11 +go 1.26.0 // This `replace` is only for CI to function. // The correct version will get resolved from below when this module is diff --git a/go.work b/go.work index 6087dc5f..96d600e3 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.26.11 +go 1.26.0 use ( ./client diff --git a/plugin/go.mod b/plugin/go.mod index 81cf7e4e..befd5d1e 100644 --- a/plugin/go.mod +++ b/plugin/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/plugin -go 1.26.11 +go 1.26.0 // This `replace` is only for CI to function. // The correct version will get resolved from below when this module is diff --git a/plugins/credentialhelper/go.mod b/plugins/credentialhelper/go.mod index 5bcee3a8..1a2abd6c 100644 --- a/plugins/credentialhelper/go.mod +++ b/plugins/credentialhelper/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/plugins/credentialhelper -go 1.26.11 +go 1.26.0 // This `replace` is only for CI to function. // The correct version will get resolved from below when this module is diff --git a/plugins/pass/go.mod b/plugins/pass/go.mod index 2bf35874..b9271b63 100644 --- a/plugins/pass/go.mod +++ b/plugins/pass/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/plugins/pass -go 1.26.11 +go 1.26.0 replace github.com/docker/secrets-engine/client => ./../../client diff --git a/store/go.mod b/store/go.mod index 1fc7b608..f3427d54 100644 --- a/store/go.mod +++ b/store/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/store -go 1.26.11 +go 1.26.0 // This `replace` is only for CI to function. // The correct version will get resolved from below when this module is diff --git a/vendor/modules.txt b/vendor/modules.txt index 09cbf4a5..af81bb96 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -27,13 +27,13 @@ github.com/danieljoos/wincred github.com/docker/docker-credential-helpers/client github.com/docker/docker-credential-helpers/credentials # github.com/docker/secrets-engine/client v1.1.0 => ./client -## explicit; go 1.26.11 +## explicit; go 1.26.0 # github.com/docker/secrets-engine/plugin v0.5.0 => ./plugin -## explicit; go 1.26.11 +## explicit; go 1.26.0 # github.com/docker/secrets-engine/secrets v1.0.0 => ./secrets ## explicit; go 1.26.0 # github.com/docker/secrets-engine/store v1.0.0 => ./store -## explicit; go 1.26.11 +## explicit; go 1.26.0 # github.com/godbus/dbus/v5 v5.1.0 ## explicit; go 1.12 github.com/godbus/dbus/v5 diff --git a/x/go.mod b/x/go.mod index 1f85a88d..ce4b7000 100644 --- a/x/go.mod +++ b/x/go.mod @@ -1,6 +1,6 @@ module github.com/docker/secrets-engine/x -go 1.26.11 +go 1.26.0 // This `replace` is only for CI to function. // The correct version will get resolved from below when this module is