Skip to content

Commit

Permalink
return standardized test for health endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tariq1890 committed May 24, 2019
1 parent 4efb3d0 commit 4bab113
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ func serveMetrics(collectors []*coll.Collector, host string, port int, enableGZI
mux.Handle(metricsPath, &metricHandler{collectors, enableGZIPEncoding})
// Add healthzPath
mux.HandleFunc(healthzPath, func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("ok"))
w.WriteHeader(http.StatusOK)
w.Write([]byte(http.StatusText(http.StatusOK)))
})
// Add index
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ kubectl proxy &
# this for loop waits until kube-state-metrics is running by accessing the healthz endpoint
for _ in {1..30}; do # timeout for 1 minutes
KUBE_STATE_METRICS_STATUS=$(curl -s "http://localhost:8001/api/v1/namespaces/kube-system/services/kube-state-metrics:http-metrics/proxy/healthz")
if [[ "$KUBE_STATE_METRICS_STATUS" == "ok" ]]; then
if [[ "${KUBE_STATE_METRICS_STATUS}" == "OK" ]]; then
is_kube_state_metrics_running="true"
break
fi
Expand Down

0 comments on commit 4bab113

Please sign in to comment.