From 6c8aabc83252e5f77a33b7bd8e3481b4adffc377 Mon Sep 17 00:00:00 2001 From: hui luo Date: Fri, 17 May 2019 16:59:05 -0700 Subject: [PATCH] Check KUBE_SERVER_PLATFORMS existence when compile kubectl on platform other than linux/amd64, we need to check the KUBE_SERVER_PLATFORMS array emptiness before assign it. the example command is: make WHAT=cmd/kubectl KUBE_BUILD_PLATFORMS="darwin/amd64 windows/amd64" --- hack/lib/golang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 4b928b8c541..e9c3b066925 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -302,7 +302,7 @@ kube::golang::server_test_targets() { IFS=" " read -ra KUBE_TEST_SERVER_TARGETS <<< "$(kube::golang::server_test_targets)" readonly KUBE_TEST_SERVER_TARGETS readonly KUBE_TEST_SERVER_BINARIES=("${KUBE_TEST_SERVER_TARGETS[@]##*/}") -readonly KUBE_TEST_SERVER_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") +readonly KUBE_TEST_SERVER_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]:+"${KUBE_SERVER_PLATFORMS[@]}"}") # Gigabytes necessary for parallel platform builds. # As of January 2018, RAM usage is exceeding 30G