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 ...@@ -141,7 +141,7 @@ module Clusters
end end
def kubeclient_ssl_options def kubeclient_ssl_options
opts = { verify_ssl: OpenSSL::SSL::VERIFY_NONE } opts = { verify_ssl: OpenSSL::SSL::VERIFY_PEER }
if ca_pem.present? if ca_pem.present?
opts[:cert_store] = OpenSSL::X509::Store.new opts[:cert_store] = OpenSSL::X509::Store.new
......
...@@ -220,6 +220,10 @@ class Environment < ActiveRecord::Base ...@@ -220,6 +220,10 @@ class Environment < ActiveRecord::Base
self.environment_type || self.name self.environment_type || self.name
end end
def deployment_platform
project.deployment_platform
end
def prometheus_adapter def prometheus_adapter
@prometheus_adapter ||= if service_prometheus_adapter.can_query? @prometheus_adapter ||= if service_prometheus_adapter.can_query?
service_prometheus_adapter service_prometheus_adapter
...@@ -233,9 +237,9 @@ class Environment < ActiveRecord::Base ...@@ -233,9 +237,9 @@ class Environment < ActiveRecord::Base
end end
def cluster_prometheus_adapter 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? return unless cluster.application_prometheus&.installed?
cluster.application_prometheus 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