mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Dedup binaries when building
This commit is contained in:
parent
9256031a87
commit
0af3106442
@ -964,6 +964,7 @@ kube::golang::build_binaries() {
|
|||||||
if [[ ${#targets[@]} -eq 0 ]]; then
|
if [[ ${#targets[@]} -eq 0 ]]; then
|
||||||
targets=("${KUBE_ALL_TARGETS[@]}")
|
targets=("${KUBE_ALL_TARGETS[@]}")
|
||||||
fi
|
fi
|
||||||
|
kube::util::read-array targets < <(kube::golang::dedup "${targets[@]}")
|
||||||
|
|
||||||
local -a platforms
|
local -a platforms
|
||||||
IFS=" " read -ra platforms <<< "${KUBE_BUILD_PLATFORMS:-}"
|
IFS=" " read -ra platforms <<< "${KUBE_BUILD_PLATFORMS:-}"
|
||||||
@ -972,7 +973,7 @@ kube::golang::build_binaries() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local -a binaries
|
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
|
local parallel=false
|
||||||
if [[ ${#platforms[@]} -gt 1 ]]; then
|
if [[ ${#platforms[@]} -gt 1 ]]; then
|
||||||
|
@ -832,8 +832,8 @@ function kube::util::md5() {
|
|||||||
# kube::util::read-array
|
# kube::util::read-array
|
||||||
# Reads in stdin and adds it line by line to the array provided. This can be
|
# 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
|
# 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
|
# exists and is an array, it will be overwritten. Otherwise it will be unset
|
||||||
# recreated.
|
# and recreated.
|
||||||
#
|
#
|
||||||
# Assumed vars:
|
# Assumed vars:
|
||||||
# $1 (name of array to create/modify)
|
# $1 (name of array to create/modify)
|
||||||
|
Loading…
Reference in New Issue
Block a user