Skip to content

Commit

Permalink
Remove MonitoringManager
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Mar 1, 2024
1 parent e005f4d commit 03d86c3
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 885 deletions.
31 changes: 1 addition & 30 deletions app/models/manageiq/providers/kubernetes/container_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class ManageIQ::Providers::Kubernetes::ContainerManager < ManageIQ::Providers::C
DEFAULT_PORT = 6443
METRICS_ROLES = %w[prometheus].freeze

include HasInfraManagerMixin
include ManageIQ::Providers::Kubernetes::ContainerManager::Options

before_save :stop_event_monitor_queue_on_change, :stop_refresh_worker_queue_on_change
Expand All @@ -22,12 +23,6 @@ def allow_targeted_refresh?
true
end

def monitoring_manager_needed?
connection_configurations.roles.include?(
ManageIQ::Providers::Kubernetes::MonitoringManagerMixin::ENDPOINT_ROLE.to_s
)
end

supports :metrics do
_("No metrics endpoint has been added") unless metrics_endpoint_exists?
end
Expand All @@ -36,13 +31,6 @@ def metrics_endpoint_exists?
endpoints.where(:role => METRICS_ROLES).exists?
end

# See HasMonitoringManagerMixin
has_one :monitoring_manager,
:foreign_key => :parent_ems_id,
:class_name => "ManageIQ::Providers::Kubernetes::MonitoringManager",
:autosave => true,
:dependent => :destroy

def self.ems_type
@ems_type ||= "kubernetes".freeze
end
Expand Down Expand Up @@ -688,18 +676,6 @@ def self.verify_prometheus_credentials(hostname, port, options)
!!prometheus_connect(hostname, port, options)&.query(:query => "ALL")&.kind_of?(Hash)
end

def self.verify_prometheus_alerts_credentials(hostname, port, options)
!!module_parent::MonitoringManager.verify_credentials(
:url => raw_api_endpoint(hostname, port),
:path => options[:path] || "/topics/alerts",
:credentials => {:token => options[:bearer]},
:ssl => {
:verify => options.dig(:ssl_options, :verify_ssl) != OpenSSL::SSL::VERIFY_NONE,
:cert_store => options.dig(:ssl_options, :ca_file)
}
)
end

def self.kubevirt_connect(hostname, port, options)
ManageIQ::Providers::Kubevirt::InfraManager.raw_connect(:server => hostname, :port => port, :token => options[:bearer])
end
Expand Down Expand Up @@ -750,11 +726,6 @@ def verify_prometheus_credentials
client.prometheus_try_connect
end

def verify_prometheus_alerts_credentials
ensure_monitoring_manager
monitoring_manager.verify_credentials
end

def verify_kubevirt_credentials
ensure_infra_manager
options = {
Expand Down
100 changes: 0 additions & 100 deletions app/models/manageiq/providers/kubernetes/monitoring_manager.rb

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 03d86c3

Please sign in to comment.