Fix building with GOFLAGS=-v

With go1.15 running go version with "-v" fails, and we should support
it.
This commit is contained in:
Odin Ugedal 2020-08-15 17:44:07 +02:00
parent 529c13471b
commit 1524794231
No known key found for this signature in database
GPG Key ID: AFF9C8242CF7A7AF

View File

@ -465,7 +465,7 @@ EOF
fi
local go_version
IFS=" " read -ra go_version <<< "$(go version)"
IFS=" " read -ra go_version <<< "$(GOFLAGS='' go version)"
local minimum_go_version
minimum_go_version=go1.15.0
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
@ -777,7 +777,7 @@ kube::golang::build_binaries() {
(
# Check for `go` binary and set ${GOPATH}.
kube::golang::setup_env
V=2 kube::log::info "Go version: $(go version)"
V=2 kube::log::info "Go version: $(GOFLAGS='' go version)"
local host_platform
host_platform=$(kube::golang::host_platform)