Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cns/healthserver/healthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewHealthzHandlerWithChecks(cnsConfig *configuration.CNSConfig) (http.Handl

// strip prefix so that it runs through all checks registered on the handler.
// otherwise it will look for a check named "healthz" and return a 404 if not there.
return http.StripPrefix("/healthz", &healthz.Handler{
return &healthz.Handler{
Checks: checks,
}), nil
}, nil
}
1 change: 1 addition & 0 deletions cns/healthserver/healthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func TestNewHealthzHandlerWithChecks(t *testing.T) {

responseRecorder := httptest.NewRecorder()
healthHandler, err := NewHealthzHandlerWithChecks(tt.cnsConfig)
healthHandler = http.StripPrefix("/healthz", healthHandler)
require.NoError(t, err)

healthHandler.ServeHTTP(responseRecorder, httptest.NewRequest("GET", "/healthz", http.NoBody))
Expand Down
Loading