Commit 2c5ee325 authored by Sean Arnold's avatar Sean Arnold Committed by Dmitriy Zaporozhets

Stop liveness check returning incorrect data

parent c4b5c533
...@@ -20,9 +20,7 @@ class HealthController < ActionController::Base ...@@ -20,9 +20,7 @@ class HealthController < ActionController::Base
end end
def liveness def liveness
results = CHECKS.map { |check| [check.name, check.liveness] } render json: { status: 'ok' }, status: :ok
render_check_results(results)
end end
private private
......
---
title: Changes response body of liveness check to be more accurate
merge_request: 17655
author:
type: changed
...@@ -116,28 +116,11 @@ curl 'https://gitlab.example.com/-/liveness' ...@@ -116,28 +116,11 @@ curl 'https://gitlab.example.com/-/liveness'
Example response: Example response:
On success, the endpoint will return a valid successful HTTP status code, and a response like below. On success, the endpoint will return a `200` HTTP status code, and a response like below.
```json ```json
{ {
"db_check":{ "status": "ok"
"status":"ok"
},
"redis_check":{
"status":"ok"
},
"cache_check":{
"status":"ok"
},
"queues_check":{
"status":"ok"
},
"shared_state_check":{
"status":"ok"
},
"gitaly_check":{
"status":"ok"
}
} }
``` ```
......
...@@ -15,10 +15,6 @@ module Gitlab ...@@ -15,10 +15,6 @@ module Gitlab
raise NotImplementedError raise NotImplementedError
end end
def liveness
HealthChecks::Result.new(true)
end
def metrics def metrics
[] []
end end
......
...@@ -76,10 +76,7 @@ describe HealthController do ...@@ -76,10 +76,7 @@ describe HealthController do
it 'responds with liveness checks data' do it 'responds with liveness checks data' do
subject subject
expect(json_response['db_check']['status']).to eq('ok') expect(json_response['status']).to eq('ok')
expect(json_response['cache_check']['status']).to eq('ok')
expect(json_response['queues_check']['status']).to eq('ok')
expect(json_response['shared_state_check']['status']).to eq('ok')
end end
end end
......
...@@ -58,9 +58,4 @@ shared_context 'simple_check' do |metrics_prefix, check_name, success_result| ...@@ -58,9 +58,4 @@ shared_context 'simple_check' do |metrics_prefix, check_name, success_result|
it { is_expected.to have_attributes(success: false, message: "#{described_class.human_name} check timed out") } it { is_expected.to have_attributes(success: false, message: "#{described_class.human_name} check timed out") }
end end
end end
describe '#liveness' do
subject { described_class.readiness }
it { is_expected.to eq(Gitlab::HealthChecks::Result.new(true)) }
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment