Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

container provider: add External Logging Support SupportFeature #13319

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/models/manageiq/providers/container_manager.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module ManageIQ::Providers
class ContainerManager < BaseManager
include AvailabilityMixin
include SupportsFeatureMixin

has_many :container_nodes, :foreign_key => :ems_id, :dependent => :destroy
has_many :container_groups, :foreign_key => :ems_id, :dependent => :destroy
Expand All @@ -23,6 +24,12 @@ class ContainerManager < BaseManager

virtual_column :port_show, :type => :string

supports :external_logging_support do
unless respond_to?(:external_logging_route_name)
unsupported_reason_add(:external_logging_support, _('This provider type does not support external_logging_support'))
end
end

# required by aggregate_hardware
alias :all_computer_systems :computer_systems
alias :all_computer_system_ids :computer_system_ids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module ManageIQ::Providers::Openshift::ContainerManagerMixin
include ManageIQ::Providers::Kubernetes::ContainerManagerMixin

DEFAULT_PORT = 8443
DEFAULT_EXTERNAL_LOGGING_ROUTE_NAME = "logging-kibana-ops".freeze

included do
has_many :container_routes, :foreign_key => :ems_id, :dependent => :destroy
Expand Down Expand Up @@ -56,4 +57,16 @@ def connect_client(api_version, method_name)
@clients[openshift].respond_to?(method_name) ? @clients[openshift] : @clients[kubernetes]
end
end

def external_logging_route_name
DEFAULT_EXTERNAL_LOGGING_ROUTE_NAME
end

def external_logging_query
nil # should be empty to return all
end

def external_logging_path
'/'
end
end
1 change: 1 addition & 0 deletions app/models/mixins/supports_feature_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ module SupportsFeatureMixin
:create_host_aggregate => 'Host Aggregate Creation',
:create_network_router => 'Network Router Creation',
:create_security_group => 'Security Group Creation',
:external_logging_support => 'Launch External Logging UI',
:swift_service => 'Swift storage service',
:delete => 'Deletion',
:delete_aggregate => 'Host Aggregate Deletion',
Expand Down
4 changes: 4 additions & 0 deletions db/fixtures/miq_product_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3696,6 +3696,10 @@
:description: Check Compliance of Last Known Configuration
:feature_type: control
:identifier: ems_container_check_compliance
- :name: Launch External Logging
:description: Open External Logging from Container Provider
:feature_type: control
:identifier: ems_container_launch_external_logging_support
- :name: Container Deployments
:description: Container Deployments
:feature_type: node
Expand Down