mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Log error when a healthz check fails
This commit is contained in:
parent
668bedd943
commit
1bcfe90912
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user