diff options
author | Ondra Machacek <machacek.ondra@gmail.com> | 2019-04-03 21:54:43 +0200 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2019-04-03 21:54:43 +0200 |
commit | 919b19f18dfe89fcab45a2f72e8f40b2924afc34 (patch) | |
tree | be2d360ded9bfe7c94268351f6ea8d1108cbb591 | |
parent | acme_certficate: allow to write files to CWD (#54754) (diff) | |
download | ansible-919b19f18dfe89fcab45a2f72e8f40b2924afc34.tar.xz ansible-919b19f18dfe89fcab45a2f72e8f40b2924afc34.zip |
kubevirt_vm: Fix the default label (#54772)
-rw-r--r-- | lib/ansible/module_utils/kubevirt.py | 2 | ||||
-rw-r--r-- | lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/kubevirt.py b/lib/ansible/module_utils/kubevirt.py index acf2fdb228..e445554e53 100644 --- a/lib/ansible/module_utils/kubevirt.py +++ b/lib/ansible/module_utils/kubevirt.py @@ -342,7 +342,7 @@ class KubeVirtRawModule(KubernetesRawModule): template_spec['domain']['cpu']['model'] = cpu_model if labels: - template['metadata']['labels'] = labels + self.merge_dicts(template['metadata']['labels'], labels) if machine_type: template_spec['domain']['machine']['type'] = machine_type diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py index 1f9920cd18..3c6a76b0af 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py @@ -346,7 +346,7 @@ class KubeVirtVM(KubeVirtRawModule): template = definition if ephemeral else definition['spec']['template'] 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) definition = dict(self.merge_dicts(processedtemplate, definition)) |