Skip to content

Commit

Permalink
container provider: adding a link to hosted kibana
Browse files Browse the repository at this point in the history
splitting common logging launch to a feature mixin
  • Loading branch information
Erez Freiberger committed Feb 9, 2017
1 parent 2932575 commit 97ac328
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
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
13 changes: 13 additions & 0 deletions app/models/manageiq/providers/openshift/container_manager_mixin.rb
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

0 comments on commit 97ac328

Please sign in to comment.