Commit a3c9842a authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'remove-prometheus-iap-feature-flag' into 'master'

Remove prometheus IAP feature flag

See merge request gitlab-org/gitlab!36856
parents 7c67e8c7 bb6f6b69
......@@ -54,7 +54,7 @@ class PrometheusService < MonitoringService
end
def fields
result = [
[
{
type: 'checkbox',
name: 'manual_configuration',
......@@ -67,11 +67,7 @@ class PrometheusService < MonitoringService
title: 'API URL',
placeholder: s_('PrometheusService|Prometheus API Base URL, like http://prometheus.example.com/'),
required: true
}
]
if Feature.enabled?(:prometheus_service_iap_auth)
result += [
},
{
type: 'text',
name: 'google_iap_audience_client_id',
......@@ -90,9 +86,6 @@ class PrometheusService < MonitoringService
]
end
result
end
# Check we can connect to the Prometheus API
def test(*args)
prometheus_client.ping
......@@ -106,7 +99,7 @@ class PrometheusService < MonitoringService
options = { allow_local_requests: allow_local_api_url? }
if Feature.enabled?(:prometheus_service_iap_auth) && behind_iap?
if behind_iap?
# Adds the Authorization header
options[:headers] = iap_client.apply({})
end
......
---
title: Prometheus instances behind Google IAP can now be accessed via manual configurations
merge_request: 36856
author:
type: added
......@@ -262,8 +262,6 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching do
service.google_iap_audience_client_id = "IAP_CLIENT_ID.apps.googleusercontent.com"
stub_request(:post, "https://oauth2.googleapis.com/token").to_return(status: 200, body: '{"id_token": "FOO"}', headers: { 'Content-Type': 'application/json; charset=UTF-8' })
stub_feature_flags(prometheus_service_iap_auth: true)
end
it 'includes the authorization header' do
......@@ -474,11 +472,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching do
title: 'API URL',
placeholder: s_('PrometheusService|Prometheus API Base URL, like http://prometheus.example.com/'),
required: true
}
]
end
let(:feature_flagged_fields) do
[
},
{
type: 'text',
name: 'google_iap_audience_client_id',
......@@ -498,13 +492,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching do
end
it 'returns fields' do
stub_feature_flags(prometheus_service_iap_auth: false)
expect(service.fields).to eq(expected_fields)
end
it 'returns fields with feature flag on' do
stub_feature_flags(prometheus_service_iap_auth: true)
expect(service.fields).to eq(expected_fields + feature_flagged_fields)
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