etcd should be started after the trap func set

This commit is contained in:
Young
2015-04-05 03:16:27 -04:00
parent c048e6fcbf
commit 802610b13a
2 changed files with 14 additions and 6 deletions

View File

@@ -36,9 +36,6 @@ if [ "$?" != "0" ]; then
exit 1
fi
echo "Starting etcd"
kube::etcd::start
# Shut down anyway if there's an error.
set +e
@@ -106,14 +103,17 @@ cleanup()
[[ -n "${PROXY_PID-}" ]] && sudo kill "${PROXY_PID}"
[[ -n "${SCHEDULER_PID-}" ]] && sudo kill "${SCHEDULER_PID}"
[[ -n "${ETCD_PID-}" ]] && kill "${ETCD_PID}"
[[ -n "${ETCD_DIR-}" ]] && rm -rf "${ETCD_DIR}"
[[ -n "${ETCD_PID-}" ]] && kube::etcd::stop
[[ -n "${ETCD_DIR-}" ]] && kube::etcd::clean_etcd_dir
exit 0
}
trap cleanup EXIT
echo "Starting etcd"
kube::etcd::start
APISERVER_LOG=/tmp/kube-apiserver.log
sudo -E "${GO_OUT}/kube-apiserver" \
--v=${LOG_LEVEL} \