Fix failing test, when deployment platform is not bound to a cluster.

This commit is contained in:
Pawel Chojnacki 2018-02-26 12:40:40 +01:00
parent 0feeddaa0f
commit 637c955862
1 changed files with 4 additions and 2 deletions

View File

@ -233,8 +233,10 @@ class Environment < ActiveRecord::Base
end
def cluster_prometheus_adapter
cluster = project.deployment_platform&.cluster
return unless cluster&.application_prometheus&.installed?
return unless project.deployment_platform.respond_to?(:cluster)
cluster = project.deployment_platform.cluster
return unless cluster.application_prometheus&.installed?
cluster.application_prometheus
end