diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 03:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 03:08:46 +0300 |
commit | 47d1f417f03aca055b2ba49c32bb6fb01c459831 (patch) | |
tree | 200f05f28369cbf3a34abcb4a3c388558268b86f /app/services/projects | |
parent | 006e89697dd5165f355afc20fc6bb0cdfa7b381a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/projects')
-rw-r--r-- | app/services/projects/operations/update_service.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/services/projects/operations/update_service.rb b/app/services/projects/operations/update_service.rb index 3ee6c2467c2..f0144ad1213 100644 --- a/app/services/projects/operations/update_service.rb +++ b/app/services/projects/operations/update_service.rb @@ -15,6 +15,7 @@ module Projects error_tracking_params .merge(metrics_setting_params) .merge(grafana_integration_params) + .merge(prometheus_integration_params) end def metrics_setting_params @@ -77,6 +78,15 @@ module Projects { grafana_integration_attributes: attrs.merge(_destroy: destroy) } end + + def prometheus_integration_params + return {} unless attrs = params[:prometheus_integration_attributes] + + service = project.find_or_initialize_service(::PrometheusService.to_param) + service.assign_attributes(attrs) + + { prometheus_service_attributes: service.attributes.except(*%w(id project_id created_at updated_at)) } + end end end end |