Skip to content

Commit 002974b

Browse files
committed
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
1 parent 0ea41c4 commit 002974b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV GOTOOLCHAIN=auto
1313
# Ensure correct Go version
1414
RUN \
1515
# get Go version from mod file
16-
export GO_VERSION=$(grep -E "go [[:digit:]]\.[[:digit:]][[:digit:]]" go.mod | awk '{print $2}') && \
16+
export GO_VERSION=$(grep -oE "go [[:digit:]]\.[[:digit:]][[:digit:]]" go.mod | awk '{print $2}') && \
1717
echo ${GO_VERSION} && \
1818
# find filename for latest z version from Go download page
1919
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") && \

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/medik8s/self-node-remediation
22

3-
go 1.23
3+
go 1.23.0
44

55
require (
66
github.com/go-logr/logr v1.4.2

0 commit comments

Comments
 (0)