@@ -137,8 +137,8 @@ readonly KUBE_NODE_BINARIES_WIN=("${KUBE_NODE_BINARIES[@]/%/.exe}")
137
137
# NOTE: All functions that return lists should use newlines.
138
138
# bash functions can't return arrays, and spaces are tricky, so newline
139
139
# separators are the preferred pattern.
140
- # To transform a string of newline-separated items to an array, use mapfile -t :
141
- # mapfile -t FOO <<< "$ (kube::golang::dups a b c a)"
140
+ # To transform a string of newline-separated items to an array, use kube::util::read-array :
141
+ # kube::util::read-array FOO < < (kube::golang::dups a b c a)
142
142
#
143
143
# ALWAYS remember to quote your subshells. Not doing so will break in
144
144
# bash 4.3, and potentially cause other issues.
@@ -172,33 +172,33 @@ kube::golang::setup_platforms() {
172
172
173
173
# Deduplicate to ensure the intersection trick with kube::golang::dups
174
174
# is not defeated by duplicates in user input.
175
- mapfile -t platforms <<< " $ (kube::golang::dedup " ${platforms[@]} " )"
175
+ kube::util::read-array platforms < < ( kube::golang::dedup " ${platforms[@]} " )
176
176
177
177
# Use kube::golang::dups to restrict the builds to the platforms in
178
178
# KUBE_SUPPORTED_*_PLATFORMS. Items should only appear at most once in each
179
179
# set, so if they appear twice after the merge they are in the intersection.
180
- mapfile -t KUBE_SERVER_PLATFORMS <<< " $ (kube::golang::dups \
180
+ kube::util::read-array KUBE_SERVER_PLATFORMS < < ( kube::golang::dups \
181
181
" ${platforms[@]} " \
182
182
" ${KUBE_SUPPORTED_SERVER_PLATFORMS[@]} " \
183
- )"
183
+ )
184
184
readonly KUBE_SERVER_PLATFORMS
185
185
186
- mapfile -t KUBE_NODE_PLATFORMS <<< " $ (kube::golang::dups \
186
+ kube::util::read-array KUBE_NODE_PLATFORMS < < ( kube::golang::dups \
187
187
" ${platforms[@]} " \
188
188
" ${KUBE_SUPPORTED_NODE_PLATFORMS[@]} " \
189
- )"
189
+ )
190
190
readonly KUBE_NODE_PLATFORMS
191
191
192
- mapfile -t KUBE_TEST_PLATFORMS <<< " $ (kube::golang::dups \
192
+ kube::util::read-array KUBE_TEST_PLATFORMS < < ( kube::golang::dups \
193
193
" ${platforms[@]} " \
194
194
" ${KUBE_SUPPORTED_TEST_PLATFORMS[@]} " \
195
- )"
195
+ )
196
196
readonly KUBE_TEST_PLATFORMS
197
197
198
- mapfile -t KUBE_CLIENT_PLATFORMS <<< " $ (kube::golang::dups \
198
+ kube::util::read-array KUBE_CLIENT_PLATFORMS < < ( kube::golang::dups \
199
199
" ${platforms[@]} " \
200
200
" ${KUBE_SUPPORTED_CLIENT_PLATFORMS[@]} " \
201
- )"
201
+ )
202
202
readonly KUBE_CLIENT_PLATFORMS
203
203
204
204
elif [[ " ${KUBE_FASTBUILD:- } " == " true" ]]; then
0 commit comments