fix(taskfile): detect Go version from go directive as fallback

Renovate now updates the `go` directive in `go.mod` directly and drops
the redundant `toolchain` line, which broke the `GO_VERSION` lookup in
the Taskfile and caused `task ci` to fail with an empty version.

Read the `toolchain` line when present and fall back to the `go`
directive otherwise. Update the Dockerfile comments to match.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2026-05-18 16:18:38 +02:00
parent 89d1e3be20
commit 2b2c25ffc1
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ output: prefixed
# Variables that are shared across tasks.
vars:
GO_VERSION:
sh: sed -n 's/^toolchain go//p' go.mod
sh: sed -n 's/^toolchain go//p' go.mod | grep . || sed -n 's/^go //p' go.mod
# renovate: datasource=docker depName=kindest/node versioning=semver
E2E_KUBERNETES_VERSION: v1.35.1
E2E_CLUSTER_NAME: barman-cloud-plugin-e2e-{{.E2E_KUBERNETES_VERSION}}

View File

@ -1,5 +1,5 @@
# Build the manager binary
# GO_VERSION must be passed as a build arg (read from go.mod toolchain directive by Taskfile)
# GO_VERSION must be passed as a build arg (read from go.mod by Taskfile)
ARG GO_VERSION
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS gobuilder
ARG TARGETOS

View File

@ -5,7 +5,7 @@
# Both components are built before going into a distroless container
# Build the manager binary
# GO_VERSION must be passed as a build arg (read from go.mod toolchain directive by Taskfile)
# GO_VERSION must be passed as a build arg (read from go.mod by Taskfile)
ARG GO_VERSION
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION} AS gobuilder
ARG TARGETOS