mirror of
https://github.com/coredns/coredns.git
synced 2025-11-16 00:42:16 -05:00
Do not interrupt querying readiness probes for plugins (#6975)
* Do not interrupt querying readiness probes for plugins Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com> * Add monitor param for ready plugin Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com> * Update ready docs Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com> * Update ready docs Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com> --------- Signed-off-by: Gleb Kogtev <gleb.kogtev@gmail.com>
This commit is contained in:
@@ -50,15 +50,15 @@ func (rd *ready) onStartup() error {
|
||||
io.WriteString(w, "Shutting down")
|
||||
return
|
||||
}
|
||||
ok, todo := plugins.Ready()
|
||||
if ok {
|
||||
ready, notReadyPlugins := plugins.Ready()
|
||||
if ready {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
io.WriteString(w, http.StatusText(http.StatusOK))
|
||||
return
|
||||
}
|
||||
log.Infof("Still waiting on: %q", todo)
|
||||
log.Infof("Plugins not ready: %q", notReadyPlugins)
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
io.WriteString(w, todo)
|
||||
io.WriteString(w, notReadyPlugins)
|
||||
})
|
||||
|
||||
go func() { http.Serve(rd.ln, rd.mux) }()
|
||||
|
||||
Reference in New Issue
Block a user