Guard both kill and wait with APISERVER_PID.

This commit is contained in:
Matt Liggett 2016-01-11 11:40:19 -08:00
parent 146a9e6075
commit 352c439a96

View File

@ -62,10 +62,11 @@ function startApiServer() {
function killApiServer() {
kube::log::status "Killing api server"
[[ -n ${APISERVER_PID-} ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null
wait ${APISERVER_PID} || true
kube::log::status "api server exited"
if [[ -n ${APISERVER_PID-} ]]; then
kill ${APISERVER_PID} 1>&2 2>/dev/null
wait ${APISERVER_PID} || true
kube::log::status "api server exited"
fi
unset APISERVER_PID
}