Merge pull request #53048 from kubermatic/log-healthz-check-fail
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Log error when a healthz check fails **What this PR does / why we need it**: Currently we only tell a user that a healthz check failed but we don't display the explicit error of the failed check. This is fine, but we should log the error to make debugging easier. ```release-note Log error of failed healthz check ``` Kubernetes-commit: 816f2f460531cc1b2ed999962b64f930a7fc39fd
This commit is contained in:
		
						commit
						4590a3380f
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -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