Commit b1a69f70 authored by Chris O'Haver's avatar Chris O'Haver Committed by GitHub

dont return 200 during shutdown (#4167)

Signed-off-by: default avatarChris O'Haver <cohaver@infoblox.com>
parent a0f71208
...@@ -43,6 +43,13 @@ func (rd *ready) onStartup() error { ...@@ -43,6 +43,13 @@ func (rd *ready) onStartup() error {
rd.Unlock() rd.Unlock()
rd.mux.HandleFunc("/ready", func(w http.ResponseWriter, _ *http.Request) { rd.mux.HandleFunc("/ready", func(w http.ResponseWriter, _ *http.Request) {
rd.Lock()
defer rd.Unlock()
if !rd.done {
w.WriteHeader(http.StatusServiceUnavailable)
io.WriteString(w, "Shutting down")
return
}
ok, todo := plugins.Ready() ok, todo := plugins.Ready()
if ok { if ok {
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment