Skip to content

Commit

Permalink
Merge pull request ManageIQ#98 from zakiva/add_template_labels
Browse files Browse the repository at this point in the history
Container Template: Allow instantiation with object_labels
  • Loading branch information
simon3z authored Sep 18, 2017
2 parents 688be32 + eb75954 commit 0a9976a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ module ManageIQ::Providers::Kubernetes::ContainerManager::ContainerTemplateMixin
extend ActiveSupport::Concern
include ManageIQ::Providers::Kubernetes::ContainerManager::EntitiesMapping

def instantiate(params, project = nil)
def instantiate(params, project = nil, labels = nil)
project ||= container_project.name
labels ||= object_labels
processed_template = process_template(ext_management_system.connect,
:metadata => {
:name => name,
:namespace => project
},
:objects => objects,
:parameters => params.collect(&:instantiation_attributes))
:parameters => params.collect(&:instantiation_attributes),
:labels => labels)
create_objects(processed_template['objects'], project)
@created_objects.each { |obj| obj[:miq_class] = model_by_entity(obj[:kind].underscore) }
end
Expand Down

0 comments on commit 0a9976a

Please sign in to comment.