1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/webhooks/handlers/probe.go
Charles-Edouard Brétéché f2bfc13edb
fix: stop using lister in tls renewer (#7629)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-06-21 13:35:43 +00:00

17 lines
315 B
Go

package handlers
import (
"context"
"net/http"
)
func Probe(check func(context.Context) bool) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if check != nil {
if !check(r.Context()) {
w.WriteHeader(http.StatusInternalServerError)
}
}
w.WriteHeader(http.StatusOK)
}
}