Merge pull request #46862 from dims/respect-build-platform-env-var

Automatic merge from submit-queue (batch tested with PRs 49083, 45540, 46862)

Respect KUBE_BUILD_PLATFORMS set by user

**What this PR does / why we need it**:

Currently the only(?) toggle available for custom arch builds is
KUBE_FASTBUILD. We should allow the user to specify a list
of arch(es) in the environment variable KUBE_BUILD_PLATFORMS.

Example:
KUBE_BUILD_PLATFORMS="linux/amd64 linux/arm64" hack/build-cross.sh

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #20365

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-07-19 21:18:27 -07:00 committed by GitHub
commit 9e5eb70d55

View File

@ -53,7 +53,12 @@ readonly KUBE_NODE_TARGETS=($(kube::golang::node_targets))
readonly KUBE_NODE_BINARIES=("${KUBE_NODE_TARGETS[@]##*/}")
readonly KUBE_NODE_BINARIES_WIN=("${KUBE_NODE_BINARIES[@]/%/.exe}")
if [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then
if [[ -n "${KUBE_BUILD_PLATFORMS:-}" ]]; then
readonly KUBE_SERVER_PLATFORMS=(${KUBE_BUILD_PLATFORMS})
readonly KUBE_NODE_PLATFORMS=(${KUBE_BUILD_PLATFORMS})
readonly KUBE_TEST_PLATFORMS=(${KUBE_BUILD_PLATFORMS})
readonly KUBE_CLIENT_PLATFORMS=(${KUBE_BUILD_PLATFORMS})
elif [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then
readonly KUBE_SERVER_PLATFORMS=(linux/amd64)
readonly KUBE_NODE_PLATFORMS=(linux/amd64)
if [[ "${KUBE_BUILDER_OS:-}" == "darwin"* ]]; then