Commit 2c090539 authored by Pawel Chojnacki's avatar Pawel Chojnacki

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

parent 637c9558
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment