Description of problem: Common template name under objects -> metadata -> labels -> vm.kubevirt.io/template contains only a partial name of the actual template name. When adding a namespace to the template (so that template validator would be used in CLI), VM creation fails. Version-Release number of selected component (if applicable): OCP 4.4.0-rc.2 CNV 2.3 (v0.26.3) How reproducible: 100% Steps to Reproduce: 1. Edit a common template - add under objects - > metadata -> labels: vm.kubevirt.io/template.namespace: openshift 2. Create a VM which uses the edited template Actual results: In the template: objects - > metadata -> labels -> vm.kubevirt.io/template = rhel7-server-tiny (template name is rhel7-server-tiny-v0.7.0) VM creation fails on: E kubernetes.client.rest.ApiException: (400) E Reason: Bad Request E HTTP response headers: HTTPHeaderDict({'Audit-Id': '66d879b0-eda6-430a-8776-cffa7440d10c', 'Content-Type': 'application/json', 'Date': 'Mon, 23 Mar 2020 17:25:45 GMT', 'Content-Length': '241'}) E HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"admission webhook \\"virt-template-admission.kubevirt.io\\" denied the request: missing parent template (key=openshift/rhel7-server-tiny) for rhel-7-6","code":400}\n' Expected results: VM creation should succeed. Additional info: Workaround - edit the template, set objects - > metadata -> labels -> vm.kubevirt.io/template = full template name (e.g rhel7-server-tiny-v0.7.0) VM creation will succeed.
Will be fixed by: https://github.com/kubevirt/common-templates/pull/147
Verified on CNV-2.4.0, OCP: 4.5.0-rc.2, SSP build 58. Template objects - > metadata -> labels -> vm.kubevirt.io/template match the template name.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:3194