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
end
def liveness
results = CHECKS.map { |check| [check.name, check.liveness] }
render_check_results(results)
render json: { status: 'ok' }, status: :ok
end
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'
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
{
"db_check":{
"status":"ok"
},
"redis_check":{
"status":"ok"
},
"cache_check":{
"status":"ok"
},
"queues_check":{
"status":"ok"
},
"shared_state_check":{
"status":"ok"
},
"gitaly_check":{
"status":"ok"
}
"status": "ok"
}
```
......
......@@ -15,10 +15,6 @@ module Gitlab
raise NotImplementedError
end
def liveness
HealthChecks::Result.new(true)
end
def metrics
[]
end
......
......@@ -76,10 +76,7 @@ describe HealthController do
it 'responds with liveness checks data' do
subject
expect(json_response['db_check']['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')
expect(json_response['status']).to eq('ok')
end
end
......
......@@ -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") }
end
end
describe '#liveness' do
subject { described_class.readiness }
it { is_expected.to eq(Gitlab::HealthChecks::Result.new(true)) }
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