Add kube::util::wait-for-jobs to report status, unlike builtin wait

** Sigh **

Fixes an additional complaint in #6463
This commit is contained in:
Zach Loafman
2015-04-06 11:09:43 -07:00
parent 1ecb926ace
commit 2bc5dd559a
2 changed files with 15 additions and 4 deletions

View File

@@ -95,3 +95,14 @@ kube::util::host_platform() {
esac
echo "${host_os}/${host_arch}"
}
# Wait for background jobs to finish. Return with
# an error status if any of the jobs failed.
kube::util::wait-for-jobs() {
local fail=0
local job
for job in $(jobs -p); do
wait "${job}" || fail=$((fail + 1))
done
return ${fail}
}