Skip to content

Commit 76e9089

Browse files
authored
Merge pull request kubernetes#72586 from dims/revert-generate-stack-traces-for-http-response
Revert "Generate Stack Traces for http response with status code zero"
2 parents 2a86eeb + 85ae156 commit 76e9089

File tree

1 file changed

+1
-12
lines changed
  • staging/src/k8s.io/apiserver/pkg/server/filters

1 file changed

+1
-12
lines changed

staging/src/k8s.io/apiserver/pkg/server/filters/wrap.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ import (
2525
"k8s.io/apiserver/pkg/server/httplog"
2626
)
2727

28-
func badHTTPResponse() httplog.StacktracePred {
29-
return func(status int) bool {
30-
// http status code should not be zero
31-
if status == 0 {
32-
klog.Errorf("Bad HTTP Response - status is zero")
33-
return true
34-
}
35-
return false
36-
}
37-
}
38-
3928
// WithPanicRecovery wraps an http Handler to recover and log panics.
4029
func WithPanicRecovery(handler http.Handler) http.Handler {
4130
return withPanicRecovery(handler, func(w http.ResponseWriter, req *http.Request, err interface{}) {
@@ -50,7 +39,7 @@ func withPanicRecovery(handler http.Handler, crashHandler func(http.ResponseWrit
5039
crashHandler(w, req, err)
5140
})
5241

53-
logger := httplog.NewLogged(req, &w).StacktraceWhen(badHTTPResponse())
42+
logger := httplog.NewLogged(req, &w)
5443
defer logger.Log()
5544

5645
// Dispatch to the internal handler

0 commit comments

Comments
 (0)