use deployment_platform DI in environment and revert changes to k8s cert verification policy
This commit is contained in:
parent
637c955862
commit
2c090539f2
|
@ -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
|
||||||
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
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue