From 9dfceda3a85bbcf323abdccd823f8dea85d3615f Mon Sep 17 00:00:00 2001 From: oraz Date: Tue, 10 Dec 2024 14:04:11 +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 | 4 ++-- go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f633639..69edee27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,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") && \ @@ -36,7 +36,7 @@ COPY version/ version/ # Build RUN ./hack/build.sh . -# Use ubi8 micro as base image to package the manager binary +# Use ubi9 micro as base image to package the manager binary FROM registry.access.redhat.com/ubi9/ubi-micro:latest WORKDIR / COPY --from=builder /workspace/manager . diff --git a/go.mod b/go.mod index dcc1d374..34c2b9ab 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/medik8s/machine-deletion-remediation -go 1.23 +go 1.23.0 require ( github.com/go-logr/logr v1.4.2