mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
15 lines
292 B
Go
15 lines
292 B
Go
|
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)
|
||
|
}
|
||
|
}
|