Skip to content

Commit

Permalink
Merge pull request openshift#725 from abhinavdahiya/server_200_healthz
Browse files Browse the repository at this point in the history
server: update healthz to return 200 instead of 204
  • Loading branch information
openshift-merge-robot authored May 15, 2019
2 parents 716a567 + d7eeed1 commit d489e70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type healthHandler struct{}
func (h *healthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Length", "0")
if r.Method == http.MethodGet || r.Method == http.MethodHead {
w.WriteHeader(http.StatusNoContent)
w.WriteHeader(http.StatusOK)
return
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/server/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestHealthzHandler(t *testing.T) {
return new(ignv2_2types.Config), nil
},
checkResponse: func(t *testing.T, response *http.Response) {
checkStatus(t, response, http.StatusNoContent)
checkStatus(t, response, http.StatusOK)
checkContentLength(t, response, 0)
checkBodyLength(t, response, 0)
},
Expand All @@ -118,7 +118,7 @@ func TestHealthzHandler(t *testing.T) {
return new(ignv2_2types.Config), nil
},
checkResponse: func(t *testing.T, response *http.Response) {
checkStatus(t, response, http.StatusNoContent)
checkStatus(t, response, http.StatusOK)
checkContentLength(t, response, 0)
checkBodyLength(t, response, 0)
},
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestAPIServer(t *testing.T) {
return new(ignv2_2types.Config), nil
},
checkResponse: func(t *testing.T, response *http.Response) {
checkStatus(t, response, http.StatusNoContent)
checkStatus(t, response, http.StatusOK)
checkContentLength(t, response, 0)
checkBodyLength(t, response, 0)
},
Expand All @@ -272,7 +272,7 @@ func TestAPIServer(t *testing.T) {
return new(ignv2_2types.Config), nil
},
checkResponse: func(t *testing.T, response *http.Response) {
checkStatus(t, response, http.StatusNoContent)
checkStatus(t, response, http.StatusOK)
checkContentLength(t, response, 0)
checkBodyLength(t, response, 0)
},
Expand Down

0 comments on commit d489e70

Please sign in to comment.