Skip to content

Commit 8a0e3e5

Browse files
committed
fix unbounded host_platform when building with --use_go_build
It's actually used unset a couple of lines after this patch, but this just resolves it in one place instead of calling $(kube::golang::host_platform) twice.
1 parent 652a0ce commit 8a0e3e5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hack/lib/golang.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ kube::golang::build_binaries() {
233233
local version_ldflags
234234
version_ldflags=$(kube::version::ldflags)
235235

236+
local host_platform
237+
host_platform=$(kube::golang::host_platform)
238+
236239
# Use eval to preserve embedded quoted strings.
237240
local goflags
238241
eval "goflags=(${KUBE_GOFLAGS:-})"
@@ -257,7 +260,7 @@ kube::golang::build_binaries() {
257260

258261
local -a platforms=("${KUBE_BUILD_PLATFORMS[@]:+${KUBE_BUILD_PLATFORMS[@]}}")
259262
if [[ ${#platforms[@]} -eq 0 ]]; then
260-
platforms=("$(kube::golang::host_platform)")
263+
platforms=("${host_platform}")
261264
fi
262265

263266
local binaries

0 commit comments

Comments
 (0)