mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
6e813a6b9e
* refactor: use more policy interface Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> * refactor: migrate to policy interface Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> * refactor: webhooks package Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
14 lines
292 B
Go
14 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)
|
|
}
|
|
}
|