Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-24 03:07:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-24 03:07:31 +0300
commit3888bc4261500c275759683076e07baaf352e5ec (patch)
treeeb70e0415be41a1d713cc89f211a6045778cd6b8 /app/services/prometheus
parent33e1622bfe5afb2eea08ff06e44de490383a93e3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/prometheus')
-rw-r--r--app/services/prometheus/adapter_service.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/app/services/prometheus/adapter_service.rb b/app/services/prometheus/adapter_service.rb
index 399f4c35d66..5e8357a83f6 100644
--- a/app/services/prometheus/adapter_service.rb
+++ b/app/services/prometheus/adapter_service.rb
@@ -2,18 +2,13 @@
module Prometheus
class AdapterService
- def initialize(project, deployment_platform = nil)
- @project = project
+ attr_reader :project, :cluster
- @deployment_platform = if deployment_platform
- deployment_platform
- else
- project.deployment_platform
- end
+ def initialize(project, cluster)
+ @project = project
+ @cluster = cluster
end
- attr_reader :deployment_platform, :project
-
def prometheus_adapter
@prometheus_adapter ||= if service_prometheus_adapter.can_query?
service_prometheus_adapter
@@ -27,7 +22,7 @@ module Prometheus
end
def cluster_prometheus_adapter
- application = deployment_platform&.cluster&.application_prometheus
+ application = cluster&.application_prometheus
application if application&.available?
end