Commit e8ee6864 authored by digitalMoksha's avatar digitalMoksha

`/geo/status` can now be run on the primary geo server

parent 402c3d13
......@@ -34,7 +34,6 @@ module API
# GET /geo/status
get 'status' do
authenticate_by_gitlab_geo_node_token!
require_node_to_be_secondary!
status = ::GeoNodeStatus.current_node_status
present status, with: GeoNodeStatusEntity
......@@ -57,10 +56,6 @@ module API
def require_node_to_be_enabled!
forbidden! 'Geo node is disabled.' unless Gitlab::Geo.current_node&.enabled?
end
def require_node_to_be_secondary!
forbidden! 'Geo node is not secondary node.' unless Gitlab::Geo.current_node&.secondary?
end
end
end
end
......@@ -38,21 +38,21 @@
"health_status": { "type": "string" },
"missing_oauth_application": { "type": "boolean" },
"attachments_count": { "type": "integer" },
"attachments_failed_count": { "type": "integer" },
"attachments_synced_count": { "type": "integer" },
"attachments_failed_count": { "type": ["integer", "null"] },
"attachments_synced_count": { "type": ["integer", "null"] },
"attachments_synced_in_percentage": { "type": "string" },
"db_replication_lag_seconds": { "type": ["integer", "null"] },
"lfs_objects_count": { "type": "integer" },
"lfs_objects_failed_count": { "type": "integer" },
"lfs_objects_synced_count": { "type": "integer" },
"lfs_objects_failed_count": { "type": ["integer", "null"] },
"lfs_objects_synced_count": { "type": ["integer", "null"] },
"lfs_objects_synced_in_percentage": { "type": "string" },
"repositories_count": { "type": "integer" },
"repositories_failed_count": { "type": "integer" },
"repositories_synced_count": { "type": "integer" },
"repositories_failed_count": { "type": ["integer", "null"] },
"repositories_synced_count": { "type": ["integer", "null"] },
"repositories_synced_in_percentage": { "type": "string" },
"wikis_count": { "type": "integer" },
"wikis_failed_count": { "type": "integer" },
"wikis_synced_count": { "type": "integer" },
"wikis_failed_count": { "type": ["integer", "null"] },
"wikis_synced_count": { "type": ["integer", "null"] },
"wikis_synced_in_percentage": { "type": "string" },
"replication_slots_count": { "type": ["integer", "null"] },
"replication_slots_used_count": { "type": ["integer", "null"] },
......
......@@ -195,10 +195,11 @@ describe API::Geo do
allow(request).to receive(:requesting_node) { secondary_node }
end
it 'responds with 403' do
it 'responds with 200' do
get api('/geo/status'), nil, request.headers
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('geo_node_status')
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