From fe55b29ef0fbc69ead507272beb7656490eee340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bombo?= Date: Mon, 18 Nov 2024 15:35:54 -0600 Subject: [PATCH] csi-kata-directvolume: Remove go version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver build recipe has a script to check the current Go version against the go.mod version. However, the script is broken ($expected is unbound) and I don't believe we do this for other components. On top of this, Go should be backward-compatible. Let's keep things simple for now and we can evaluate restoring this script in the future if need be. Signed-off-by: Aurélien Bombo --- .../release-tools/build.make | 14 +------- .../release-tools/verify-go-version.sh | 35 ------------------- 2 files changed, 1 insertion(+), 48 deletions(-) delete mode 100755 src/tools/csi-kata-directvolume/release-tools/verify-go-version.sh diff --git a/src/tools/csi-kata-directvolume/release-tools/build.make b/src/tools/csi-kata-directvolume/release-tools/build.make index 23f3e54b62..27fff519e4 100644 --- a/src/tools/csi-kata-directvolume/release-tools/build.make +++ b/src/tools/csi-kata-directvolume/release-tools/build.make @@ -56,7 +56,7 @@ ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) # Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables # to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below. -build-%: check-go-version-go +build-%: mkdir -p bin CGO_ENABLED=0 GOOS=linux go build $(GOFLAGS_VENDOR) -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$* ./cmd/$* if [ "$$ARCH" = "amd64" ]; then \ @@ -92,9 +92,6 @@ push: $(CMDS:%=push-%) clean: -rm -rf bin -test: check-go-version-go - - .PHONY: test-vet test: test-vet test-vet: @@ -111,12 +108,3 @@ test-fmt: gofmt -d $$files; \ false; \ fi - - -# Targets in the makefile can depend on check-go-version- -# to trigger a warning if the x.y version of that binary does not match -# what the project uses. Make ensures that this is only checked once per -# invocation. -.PHONY: check-go-version-% -check-go-version-%: - ./release-tools/verify-go-version.sh "$*" diff --git a/src/tools/csi-kata-directvolume/release-tools/verify-go-version.sh b/src/tools/csi-kata-directvolume/release-tools/verify-go-version.sh deleted file mode 100755 index 9c35c0c97b..0000000000 --- a/src/tools/csi-kata-directvolume/release-tools/verify-go-version.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2019 The Kubernetes Authors. -# -# SPDX-License-Identifier: Apache-2.0 -# - -GO="$1" - -if [ ! "$GO" ]; then - echo >&2 "usage: $0 " - exit 1 -fi - -die () { - echo "ERROR: $*" - exit 1 -} - -version=$("$GO" version) || die "determining version of $GO failed" -# shellcheck disable=SC2001 -majorminor=$(echo "$version" | sed -e 's/.*go\([0-9]*\)\.\([0-9]*\).*/\1.\2/') - -if [ "$majorminor" != "$expected" ]; then - cat >&2 <