Skip to content

Commit 38b7f21

Browse files
authored
fix unbound array variable
1 parent adf6fa6 commit 38b7f21

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

hack/lib/golang.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ kube::golang::dedup() {
163163
# to readonly.
164164
# The configured vars will only contain platforms allowed by the
165165
# KUBE_SUPPORTED* vars at the top of this file.
166+
declare -a -g KUBE_SERVER_PLATFORMS
167+
declare -a -g KUBE_CLIENT_PLATFORMS
166168
kube::golang::setup_platforms() {
167169
if [[ -n "${KUBE_BUILD_PLATFORMS:-}" ]]; then
168170
# KUBE_BUILD_PLATFORMS needs to be read into an array before the next
@@ -202,20 +204,23 @@ kube::golang::setup_platforms() {
202204
readonly KUBE_CLIENT_PLATFORMS
203205

204206
elif [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then
205-
readonly KUBE_SERVER_PLATFORMS=(linux/amd64)
207+
KUBE_SERVER_PLATFORMS=(linux/amd64)
208+
readonly KUBE_SERVER_PLATFORMS
206209
readonly KUBE_NODE_PLATFORMS=(linux/amd64)
207210
if [[ "${KUBE_BUILDER_OS:-}" == "darwin"* ]]; then
208211
readonly KUBE_TEST_PLATFORMS=(
209212
darwin/amd64
210213
linux/amd64
211214
)
212-
readonly KUBE_CLIENT_PLATFORMS=(
215+
KUBE_CLIENT_PLATFORMS=(
213216
darwin/amd64
214217
linux/amd64
215-
)
218+
)
219+
readonly KUBE_CLIENT_PLATFORMS
216220
else
217221
readonly KUBE_TEST_PLATFORMS=(linux/amd64)
218-
readonly KUBE_CLIENT_PLATFORMS=(linux/amd64)
222+
KUBE_CLIENT_PLATFORMS=(linux/amd64)
223+
readonly KUBE_CLIENT_PLATFORMS
219224
fi
220225
else
221226
KUBE_SERVER_PLATFORMS=("${KUBE_SUPPORTED_SERVER_PLATFORMS[@]}")

0 commit comments

Comments
 (0)