Log error when a healthz check fails

Kubernetes-commit: 1bcfe909125acc567258d4937fc2c08206d14d08
This commit is contained in:
Henrik Schmidt 2017-09-26 12:58:12 +02:00 committed by Kubernetes Publisher
parent dfe8e14639
commit 9493c48653
1 changed files with 2 additions and 1 deletions

View File

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