File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
pkg/exporters/k8sexporter Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -81,23 +81,22 @@ func (ke *k8sExporter) startHTTPReporting(npdo *options.NodeProblemDetectorOptio
81
81
if npdo .ServerPort <= 0 {
82
82
return
83
83
}
84
- mux := http .DefaultServeMux
85
84
86
85
// Add healthz http request handler. Always return ok now, add more health check
87
86
// logic in the future.
88
- mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
87
+ http .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
89
88
w .WriteHeader (http .StatusOK )
90
89
w .Write ([]byte ("ok" ))
91
90
})
92
91
93
92
// Add the handler to serve condition http request.
94
- mux .HandleFunc ("/conditions" , func (w http.ResponseWriter , r * http.Request ) {
93
+ http .HandleFunc ("/conditions" , func (w http.ResponseWriter , r * http.Request ) {
95
94
util .ReturnHTTPJson (w , ke .conditionManager .GetConditions ())
96
95
})
97
96
98
97
addr := net .JoinHostPort (npdo .ServerAddress , strconv .Itoa (npdo .ServerPort ))
99
98
go func () {
100
- err := http .ListenAndServe (addr , mux )
99
+ err := http .ListenAndServe (addr , nil )
101
100
if err != nil {
102
101
klog .Fatalf ("Failed to start server: %v" , err )
103
102
}
You can’t perform that action at this time.
0 commit comments