Commit 1bcfe909 authored by Henrik Schmidt's avatar Henrik Schmidt Committed by Henrik Schmidt

Log error when a healthz check fails

parent 668bedd9
...@@ -106,9 +106,10 @@ func handleRootHealthz(checks ...HealthzChecker) http.HandlerFunc { ...@@ -106,9 +106,10 @@ func handleRootHealthz(checks ...HealthzChecker) http.HandlerFunc {
failed := false failed := false
var verboseOut bytes.Buffer var verboseOut bytes.Buffer
for _, check := range checks { 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 // don't include the error since this endpoint is public. If someone wants more detail
// they should have explicit permission to the detailed checks. // 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()) fmt.Fprintf(&verboseOut, "[-]%v failed: reason withheld\n", check.Name())
failed = true failed = true
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment