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:
Rakshith R
2021-06-25 10:32:01 +05:30
committed by mergify[bot]
parent 1b23d78113
commit 9eaa55506f
238 changed files with 19614 additions and 10805 deletions

View File

@ -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 {