From 0ab28f314a6fe19c0543d924624e9e10dbdd52db Mon Sep 17 00:00:00 2001 From: Vatsal Parekh Date: Wed, 27 Mar 2019 19:16:39 +0530 Subject: [PATCH] Added default openshift VM templates label (#54456) --- lib/ansible/modules/cloud/kubevirt/kubevirt_template.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_template.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_template.py index acff602fbad..0e3885122ee 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_template.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_template.py @@ -297,6 +297,10 @@ class KubeVirtVMTemplate(KubeVirtRawModule): # Fill in template parameters: definition['parameters'] = self.params.get('parameters') + # Fill in the default Label + labels = definition['metadata']['labels'] + labels['template.cnv.io/type'] = 'vm' + # Fill in Openshift/Kubevirt template annotations: annotations = definition['metadata']['annotations'] if self.params.get('display_name'):