From 2b2c25ffc16522c1abbfd6711f54def056549fcc Mon Sep 17 00:00:00 2001 From: Leonardo Cecchi Date: Mon, 18 May 2026 16:18:38 +0200 Subject: [PATCH] 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 --- Taskfile.yml | 2 +- containers/Dockerfile.plugin | 2 +- containers/Dockerfile.sidecar | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index e6b20db..a4755b1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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}} diff --git a/containers/Dockerfile.plugin b/containers/Dockerfile.plugin index 8fc17e6..804ee22 100644 --- a/containers/Dockerfile.plugin +++ b/containers/Dockerfile.plugin @@ -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 diff --git a/containers/Dockerfile.sidecar b/containers/Dockerfile.sidecar index b62d3e1..3970bba 100644 --- a/containers/Dockerfile.sidecar +++ b/containers/Dockerfile.sidecar @@ -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