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:
Gleb Kogtev
2025-04-08 16:46:30 +03:00
committed by GitHub
parent ebd1e41976
commit 52b3172b2e
6 changed files with 206 additions and 27 deletions

View File

@@ -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) }()