mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: update controller-runtime package to v0.9.2
This commit updates controller-runtime to v0.9.2 and makes changes in persistentvolume.go to add context to various functions and function calls made here instead of context.TODO(). Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
9
vendor/sigs.k8s.io/controller-runtime/pkg/healthz/healthz.go
generated
vendored
9
vendor/sigs.k8s.io/controller-runtime/pkg/healthz/healthz.go
generated
vendored
@ -35,7 +35,7 @@ type Handler struct {
|
||||
Checks map[string]Checker
|
||||
}
|
||||
|
||||
// checkStatus holds the output of a particular check
|
||||
// checkStatus holds the output of a particular check.
|
||||
type checkStatus struct {
|
||||
name string
|
||||
healthy bool
|
||||
@ -173,8 +173,7 @@ type CheckHandler struct {
|
||||
}
|
||||
|
||||
func (h CheckHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
|
||||
err := h.Checker(req)
|
||||
if err != nil {
|
||||
if err := h.Checker(req); err != nil {
|
||||
http.Error(resp, fmt.Sprintf("internal server error: %v", err), http.StatusInternalServerError)
|
||||
} else {
|
||||
fmt.Fprint(resp, "ok")
|
||||
@ -184,10 +183,10 @@ func (h CheckHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
|
||||
// Checker knows how to perform a health check.
|
||||
type Checker func(req *http.Request) error
|
||||
|
||||
// Ping returns true automatically when checked
|
||||
// Ping returns true automatically when checked.
|
||||
var Ping Checker = func(_ *http.Request) error { return nil }
|
||||
|
||||
// getExcludedChecks extracts the health check names to be excluded from the query param
|
||||
// getExcludedChecks extracts the health check names to be excluded from the query param.
|
||||
func getExcludedChecks(r *http.Request) sets.String {
|
||||
checks, found := r.URL.Query()["exclude"]
|
||||
if found {
|
||||
|
Reference in New Issue
Block a user