From 9493c48653e3a1068f6bd0612838b94902416507 Mon Sep 17 00:00:00 2001 From: Henrik Schmidt Date: Tue, 26 Sep 2017 12:58:12 +0200 Subject: [PATCH] Log error when a healthz check fails Kubernetes-commit: 1bcfe909125acc567258d4937fc2c08206d14d08 --- pkg/server/healthz/healthz.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/server/healthz/healthz.go b/pkg/server/healthz/healthz.go index d5dbb5ccd..bd8bfe7b5 100644 --- a/pkg/server/healthz/healthz.go +++ b/pkg/server/healthz/healthz.go @@ -106,9 +106,10 @@ func handleRootHealthz(checks ...HealthzChecker) http.HandlerFunc { failed := false var verboseOut bytes.Buffer for _, check := range checks { - if check.Check(r) != nil { + if err := check.Check(r); err != nil { // don't include the error since this endpoint is public. If someone wants more detail // they should have explicit permission to the detailed checks. + glog.V(6).Infof("healthz check %v failed: %v", check.Name(), err) fmt.Fprintf(&verboseOut, "[-]%v failed: reason withheld\n", check.Name()) failed = true } else {