Merge pull request #6472 from zmerlynn/fix_build_status

Add kube::util::wait-for-jobs to report status, unlike builtin wait
This commit is contained in:
Rohit Jnagal
2015-04-06 13:39:58 -07:00
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}
}