use deployment_platform DI in environment and revert changes to k8s cert verification policy

This commit is contained in:
Pawel Chojnacki 2018-02-26 19:57:11 +01:00
parent 637c955862
commit 2c090539f2
2 changed files with 7 additions and 3 deletions

View File

@ -141,7 +141,7 @@ module Clusters
end
def kubeclient_ssl_options
opts = { verify_ssl: OpenSSL::SSL::VERIFY_NONE }
opts = { verify_ssl: OpenSSL::SSL::VERIFY_PEER }
if ca_pem.present?
opts[:cert_store] = OpenSSL::X509::Store.new

View File

@ -220,6 +220,10 @@ class Environment < ActiveRecord::Base
self.environment_type || self.name
end
def deployment_platform
project.deployment_platform
end
def prometheus_adapter
@prometheus_adapter ||= if service_prometheus_adapter.can_query?
service_prometheus_adapter
@ -233,9 +237,9 @@ class Environment < ActiveRecord::Base
end
def cluster_prometheus_adapter
return unless project.deployment_platform.respond_to?(:cluster)
return unless deployment_platform.respond_to?(:cluster)
cluster = project.deployment_platform.cluster
cluster = deployment_platform.cluster
return unless cluster.application_prometheus&.installed?
cluster.application_prometheus