Replace mapfile with kube::util::read-array

During the review of https://github.com/kubernetes/kubernetes/pull/78779
we've known mapfile doesn't work on macOS.
So we need to use alternative way instead and this is it.
This commit is contained in:
Kenichi Omichi
2019-06-19 20:34:52 +00:00
parent c47ab33e67
commit 5628b6b50e
2 changed files with 8 additions and 6 deletions

View File

@@ -18,10 +18,12 @@ set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}"
all_e2e_files=()
# NOTE: This checks e2e test code without the e2e framework which contains Expect().To(HaveOccurred())
mapfile -t all_e2e_files < <(find test/e2e{,_node,_kubeadm} -name '*.go' | grep -v 'test/e2e/framework/')
kube::util::read-array all_e2e_files < <(find test/e2e{,_node,_kubeadm} -name '*.go' | grep -v 'test/e2e/framework/')
errors_expect_no_error=()
for file in "${all_e2e_files[@]}"
do