1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/pkg/webhooks/handlers/probe.go

15 lines
292 B
Go
Raw Normal View History

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