kubevirt_vm: Fix the default label (#54772)

This commit is contained in:
Ondra Machacek 2019-04-03 21:54:43 +02:00 committed by John R Barker
parent e422f18898
commit 919b19f18d
2 changed files with 2 additions and 2 deletions

View file

@ -342,7 +342,7 @@ class KubeVirtRawModule(KubernetesRawModule):
template_spec['domain']['cpu']['model'] = cpu_model template_spec['domain']['cpu']['model'] = cpu_model
if labels: if labels:
template['metadata']['labels'] = labels self.merge_dicts(template['metadata']['labels'], labels)
if machine_type: if machine_type:
template_spec['domain']['machine']['type'] = machine_type template_spec['domain']['machine']['type'] = machine_type

View file

@ -346,7 +346,7 @@ class KubeVirtVM(KubeVirtRawModule):
template = definition if ephemeral else definition['spec']['template'] template = definition if ephemeral else definition['spec']['template']
kind = 'VirtualMachineInstance' if ephemeral else 'VirtualMachine' kind = 'VirtualMachineInstance' if ephemeral else 'VirtualMachine'
template['labels']['vm.cnv.io/name'] = self.params.get('name') template['metadata']['labels']['vm.cnv.io/name'] = self.params.get('name')
dummy, definition = self.construct_vm_definition(kind, definition, template) dummy, definition = self.construct_vm_definition(kind, definition, template)
definition = dict(self.merge_dicts(processedtemplate, definition)) definition = dict(self.merge_dicts(processedtemplate, definition))