mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
dont return 200 during shutdown (#4167)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user