Skip to content

Commit

Permalink
Add label mapping target_class and prefix methods to container manager
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Nov 13, 2020
1 parent 7b63843 commit 9bd4439
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/models/manageiq/providers/kubernetes/container_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class ManageIQ::Providers::Kubernetes::ContainerManager < ManageIQ::Providers::C
# our specific code in ManageIQ.
delegate :api_version, :to => :class

supports :label_mapping

def api_version=(_value)
raise 'Kubernetes api_version cannot be modified'
end
Expand Down Expand Up @@ -62,4 +64,22 @@ def self.display_name(number = 1)
def self.default_port
DEFAULT_PORT
end

LABEL_MAPPING_MODELS = %w[
ContainerGroup
ContainerProject
ContainerNode
ContainerReplicator
ContainerRoute
ContainerService
ContainerBuild
].freeze

def self.entities_for_label_mapping
LABEL_MAPPING_MODELS.each_with_object({}) { |target_model, entity| entity[target_model] = target_model }
end

def self.label_mapping_prefix
ems_type
end
end

0 comments on commit 9bd4439

Please sign in to comment.