From 4128a8eb343c1e799b4fa5f0d2323ecd241380cd Mon Sep 17 00:00:00 2001 From: Christopher Maher Date: Thu, 9 Jul 2026 00:22:38 -0700 Subject: [PATCH] fix(foreman): gate Job downloads the go.mod toolchain (GOTOOLCHAIN=auto) The clean-room gate Job runs on golang:1.26 with GOTOOLCHAIN=local (baked into the official image). After go.mod's toolchain floor rose to go>=1.26.5 (#1016), the node's IfNotPresent-cached golang:1.26 (1.26.4) could no longer satisfy it, so make fmt/vet/lint failed for every change with "go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)" -- blocking every coder GO, including an examples-only diff. Set GOTOOLCHAIN=auto in the gate env so the gate downloads whatever toolchain go.mod requires into the persistent GOMODCACHE PVC (one-time per version). Immune to future go.mod patch bumps; no base-image chasing. Fixes #1018 Signed-off-by: Christopher Maher --- pkg/foreman/agent/tools/gate_job_template.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/foreman/agent/tools/gate_job_template.yaml b/pkg/foreman/agent/tools/gate_job_template.yaml index 01339b4e..1756435c 100644 --- a/pkg/foreman/agent/tools/gate_job_template.yaml +++ b/pkg/foreman/agent/tools/gate_job_template.yaml @@ -160,6 +160,14 @@ spec: value: "{{ .Branch }}" - name: BASE_BRANCH value: "{{ .BaseBranch }}" + # The base image (golang:1.26) bakes GOTOOLCHAIN=local, which + # refuses to run when go.mod's toolchain floor is newer than the + # image's Go (e.g. go.mod requires 1.26.5 but the cached + # golang:1.26 tag is still 1.26.4). Force `auto` so the gate + # downloads whatever toolchain go.mod requires into the persistent + # GOMODCACHE below, keeping the gate immune to go.mod patch bumps. + - name: GOTOOLCHAIN + value: auto - name: GOMODCACHE value: /cache/gomod - name: GOCACHE