Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etcd should be started after the trap func set #6444

Merged
merged 1 commit into from
Apr 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion hack/lib/etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@ kube::etcd::start() {
curl -X PUT "http://${host}:${port}/v2/keys/_test"
}

kube::etcd::cleanup() {
kube::etcd::stop() {
kill "${ETCD_PID-}" >/dev/null 2>&1 || :
wait "${ETCD_PID-}" >/dev/null 2>&1 || :
}

kube::etcd::clean_etcd_dir() {
rm -rf "${ETCD_DIR-}"
}

kube::etcd::cleanup() {
kube::etcd::stop
kube::etcd::clean_etcd_dir
}
10 changes: 5 additions & 5 deletions hack/local-up-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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} \
Expand Down