mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
apiserver: don't log stack trace on /healthz error
This commit is contained in:
parent
b7be36e464
commit
6e3fd91e1a
@ -25,10 +25,10 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/klog"
|
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
"k8s.io/apimachinery/pkg/util/wait"
|
"k8s.io/apimachinery/pkg/util/wait"
|
||||||
|
"k8s.io/apiserver/pkg/server/httplog"
|
||||||
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HealthzChecker is a named healthz checker.
|
// HealthzChecker is a named healthz checker.
|
||||||
@ -181,7 +181,7 @@ func handleRootHealthz(checks ...HealthzChecker) http.HandlerFunc {
|
|||||||
// always be verbose on failure
|
// always be verbose on failure
|
||||||
if failed {
|
if failed {
|
||||||
klog.V(2).Infof("%vhealthz check failed", verboseOut.String())
|
klog.V(2).Infof("%vhealthz check failed", verboseOut.String())
|
||||||
http.Error(w, fmt.Sprintf("%vhealthz check failed", verboseOut.String()), http.StatusInternalServerError)
|
http.Error(httplog.Unlogged(w), fmt.Sprintf("%vhealthz check failed", verboseOut.String()), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user