From 6309967fd477a3ca9126a0e79d3dcef132f8a62c Mon Sep 17 00:00:00 2001 From: oraz Date: Wed, 11 Dec 2024 14:41:51 +0200 Subject: [PATCH] Set Golang version for specifing the correct toolchain Using this specific toolchain we set the minimum requirement for Golang version. 'go command uses its own bundled toolchain when that toolchain is at least as new as the go or toolchain lines in the main module'. https://go.dev/doc/toolchain --- Dockerfile | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a1cf05e6..185a3aef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ COPY go.sum go.sum RUN \ # get Go version from mod file - export GO_VERSION=$(grep -E "go [[:digit:]]\.[[:digit:]][[:digit:]]" go.mod | awk '{print $2}') && \ + export GO_VERSION=$(grep -oE "go [[:digit:]]\.[[:digit:]][[:digit:]]" go.mod | awk '{print $2}') && \ echo ${GO_VERSION} && \ # find filename for latest z version from Go download page export GO_FILENAME=$(curl -sL 'https://go.dev/dl/?mode=json&include=all' | jq -r "[.[] | select(.version | startswith(\"go${GO_VERSION}\"))][0].files[] | select(.os == \"linux\" and .arch == \"amd64\") | .filename") && \ diff --git a/go.mod b/go.mod index 8276fd7c..a8288fc0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/medik8s/node-healthcheck-operator -go 1.23 +go 1.23.0 require ( github.com/go-logr/logr v1.4.2