Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bb6f6b69
Commit
bb6f6b69
authored
Jul 14, 2020
by
Dhiraj Bodicherla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove prometheus IAP feature flag
parent
2b8517ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
37 deletions
+23
-37
app/models/project_services/prometheus_service.rb
app/models/project_services/prometheus_service.rb
+17
-24
changelogs/unreleased/remove-prometheus-iap-feature-flag.yml
changelogs/unreleased/remove-prometheus-iap-feature-flag.yml
+5
-0
spec/models/project_services/prometheus_service_spec.rb
spec/models/project_services/prometheus_service_spec.rb
+1
-13
No files found.
app/models/project_services/prometheus_service.rb
View file @
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
...
...
changelogs/unreleased/remove-prometheus-iap-feature-flag.yml
0 → 100644
View file @
bb6f6b69
---
title
:
Prometheus instances behind Google IAP can now be accessed via manual configurations
merge_request
:
36856
author
:
type
:
added
spec/models/project_services/prometheus_service_spec.rb
View file @
bb6f6b69
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment