Bug 1856412

Summary: Deprecated templates have active template labels
Product: Container Native Virtualization (CNV) Reporter: Omer Yahud <oyahud>
Component: SSPAssignee: Omer Yahud <oyahud>
Status: CLOSED ERRATA QA Contact: Ruth Netser <rnetser>
Severity: high Docs Contact:
Priority: high    
Version: 2.4.0CC: alitke, cnv-qe-bugs, ksimon, ncredi, obaireys, rnetser, yzamir
Target Milestone: ---   
Target Release: 2.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-07 09:50:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Omer Yahud 2020-07-13 14:49:14 UTC
Description of problem:
Deprecated templates still have the following labels, that make them accessible to newly created VMs:

1. os.template.kubevirt.io/win2k19: "true"
2. os.template.kubevirt.io/win2k16: "true"
3. os.template.kubevirt.io/win2k12r2: "true"
4. os.template.kubevirt.io/win2k8r2: "true"
5. os.template.kubevirt.io/win2k8: "true"
6. workload.template.kubevirt.io/{{ item.workload }}: "true"
7. flavor.template.kubevirt.io/{{ item.flavor }}: "true"

The template clients (V2V and UI) query for usable templates by querying for a os/flavor/workload labels trio, removing those labels from the deprecated template, would not show it for new VM creation, but will keep it functional for validation of old VMs

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. Inspect the template resource
2.
3.

Actual results:
os/flavor/workload labels exist

Expected results:
os/flavor/workload labels should not exist

Additional info:

Comment 1 Omer Yahud 2020-08-02 08:39:03 UTC
Upstream PR: https://github.com/kubevirt/common-templates/pull/166

Comment 2 Ruth Netser 2020-09-10 10:50:43 UTC
*** Bug 1871229 has been marked as a duplicate of this bug. ***

Comment 3 Ruth Netser 2020-09-23 07:32:31 UTC
os.template.kubevirt.io were not removed from win2k12r2-desktop and win2k12r2-server templates

Comment 4 Yaacov Zamir 2020-09-29 07:48:26 UTC
Note:
The UI also uses name.os.template.kubevirt.io annotations to create a list of the OS names available,
we should also remove this annotations from deprecated templates to make sure they do not appear as options for available OS names.

Comment 5 Omer Yahud 2020-09-29 07:56:12 UTC
A PR to solve this is here: https://github.com/kubevirt/common-templates/pull/233
It also removes the annotations Yaacov mentioned

Comment 6 Ruth Netser 2020-10-05 13:26:51 UTC
kubevirt-ssp-operator-container-v2.5.0-50 - deprecated templates are not deployed:

$ oc get template -n openshift|grep -i win
windows-server-large-v0.11.3                        Template for Microsoft Windows Server 2012 R2 VM or newer. A PVC with the Win...   4 (1 blank)       1
windows-server-medium-v0.11.3                       Template for Microsoft Windows Server 2012 R2 VM or newer. A PVC with the Win...   4 (1 blank)       1
windows10-desktop-large-v0.11.3                     Template for Microsoft Windows 10 VM. A PVC with the Windows disk image must...    4 (1 blank)       1
windows10-desktop-medium-v0.11.3                    Template for Microsoft Windows 10 VM. A PVC with the Windows disk image must...    4 (1 blank)       1
$

Comment 7 Omer Yahud 2020-10-05 14:20:25 UTC
Ah, the downstream filtering script dropped it because it did not have the windows labels anymore, will look into it

Comment 8 Omer Yahud 2020-10-05 14:20:46 UTC
Ah, the downstream filtering script dropped it because it did not have the windows labels anymore, will look into it

Comment 9 Yaacov Zamir 2020-10-06 11:44:25 UTC
*** Bug 1881458 has been marked as a duplicate of this bug. ***

Comment 10 Omer Yahud 2020-10-07 09:21:49 UTC
Fix is included in kubevirt-ssp-operator-container-v2.5.0-52

Comment 11 Or Bairey-Sehayek 2020-10-08 18:03:56 UTC
All labels in bug description no longer present on deprecated windows templates (manually verified those 4 templates). Changed status to verified.