Dedup binaries when building

This commit is contained in:
Tim Hockin 2023-05-06 14:10:58 -07:00
parent 9256031a87
commit 0af3106442
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -964,6 +964,7 @@ kube::golang::build_binaries() {
if [[ ${#targets[@]} -eq 0 ]]; then
targets=("${KUBE_ALL_TARGETS[@]}")
fi
kube::util::read-array targets < <(kube::golang::dedup "${targets[@]}")
local -a platforms
IFS=" " read -ra platforms <<< "${KUBE_BUILD_PLATFORMS:-}"
@ -972,7 +973,7 @@ kube::golang::build_binaries() {
fi
local -a binaries
while IFS="" read -r binary; do binaries+=("$binary"); done < <(kube::golang::binaries_from_targets "${targets[@]}")
kube::util::read-array binaries < <(kube::golang::binaries_from_targets "${targets[@]}")
local parallel=false
if [[ ${#platforms[@]} -gt 1 ]]; then

View File

@ -832,8 +832,8 @@ function kube::util::md5() {
# kube::util::read-array
# Reads in stdin and adds it line by line to the array provided. This can be
# used instead of "mapfile -t", and is bash 3 compatible. If the named array
# exists and is an array, it will be used. Otherwise it will be unset and
# recreated.
# exists and is an array, it will be overwritten. Otherwise it will be unset
# and recreated.
#
# Assumed vars:
# $1 (name of array to create/modify)