Bug 1859235 - Common Templates - after upgrade there are 2 common templates per each os-workload-flavor combination
Summary: Common Templates - after upgrade there are 2 common templates per each os-wo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: SSP
Version: 2.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.6.0
Assignee: Vatsal Parekh
QA Contact: Ruth Netser
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-21 14:11 UTC by Ruth Netser
Modified: 2021-03-10 11:18 UTC (History)
3 users (show)

Fixed In Version: kubevirt-ssp-operator-container-v2.6.0-32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-10 11:16:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt ssp-operator pull 50 0 None closed Remove workload, flavor, os labels from templates which have older version 2021-02-12 16:04:01 UTC
Github kubevirt ssp-operator pull 71 0 None closed Remove workload, flavor, os labels from templates which have older version 2021-02-12 16:04:01 UTC
Red Hat Product Errata RHSA-2021:0799 0 None None None 2021-03-10 11:18:24 UTC

Description Ruth Netser 2020-07-21 14:11:46 UTC
Description of problem:
Upgrade CNV 2.3 -> CNV 2.4
There are 2 sets of templates.
For each os-workload-flavor combination, 2 templates are available; older and curretn versions.

Version-Release number of selected component (if applicable):
Upgrade CNV 2.3 -> CNV 2.4

How reproducible:
100%

Steps to Reproduce:
1. Upgrade CNV 2.3 -> CNV 2.4
2. $ oc get template -n openshift -l workload.template.kubevirt.io/desktop=true,flavor.template.kubevirt.io/small=true,os.template.kubevirt.io/rhel8.1=true
NAME                          DESCRIPTION                                                                        PARAMETERS    OBJECTS
rhel8-desktop-small-v0.10.0   This template can be used to create a VM suitable for Red Hat Enterprise Linu...   2 (1 blank)   1
rhel8-desktop-small-v0.7.0    This template can be used to create a VM suitable for Red Hat Enterprise Linu...   2 (1 blank)   1


Actual results:
For each os-workload-flavor combination, 2 templates are available; older and curretn versions.

Expected results:
Either older versions are deprecated (see bug 1856412) and during an upgrade, should be marked as such.
If we want to support more than one version, there should be a way to get only one, relevant template.


Additional info:

Comment 1 Omer Yahud 2020-09-07 09:54:59 UTC
We have a long term solution planned in this epic https://issues.redhat.com/browse/CNV-6624 which would solve this issue.
The epic is currently planned for 2.6, hence pushing this bug to 2.6 as well

Comment 2 Omer Yahud 2020-10-27 15:19:22 UTC
After an upgrade, the operator should query for all templates with the `base` label, remove all os/size/flavor labels, and reconcile the newest templates only.
This way, only the latest templates are visible to the UI/CLI users and the rest are hidden for template validator use only.

Comment 3 Omer Yahud 2020-10-28 06:56:09 UTC
An equivalent oc query to find the templates that need to be modified looks like this:

oc get template -l template.kubevirt.io/type="base",template.kubevirt.io/version!=$LATEST_VERSION

It returns all base templates (all templates provided by the ssp-operator) that are not of the latest version

Comment 4 Omer Yahud 2020-12-21 14:23:58 UTC
Reassigning to Vatsal because Karel is on PTO

Comment 5 Vatsal Parekh 2021-01-07 10:09:40 UTC
This got merged upstream https://github.com/kubevirt/ssp-operator/pull/71

Comment 6 Ruth Netser 2021-02-04 08:17:02 UTC
Verified with CNV 2.5.3 -> CNV 2.6.0 (kubevirt-ssp-operator-container-v2.6.0-37):

Though we have 2 templates for rhel8-desktop-small:

$ oc get template -n openshift |grep "rhel8-desktop-small"
rhel8-desktop-small                                 Template for Red Hat Enterprise Linux 8 VM or newer. A PVC with the RHEL disk...   4 (2 generated)   1
rhel8-desktop-small-v0.11.3                         Template for Red Hat Enterprise Linux 8 VM or newer. A PVC with the RHEL disk...   5 (1 blank)       1


Only one is matched:

$  oc get template -n openshift -l workload.template.kubevirt.io/desktop=true,flavor.template.kubevirt.io/small=true,os.template.kubevirt.io/rhel8.1=true
NAME                  DESCRIPTION                                                                        PARAMETERS        OBJECTS
rhel8-desktop-small   Template for Red Hat Enterprise Linux 8 VM or newer. A PVC with the RHEL disk...   4 (2 generated)   1


The previous template does not have os-flavor-workload labels but only:
  labels:
    template.kubevirt.io/type: base
    template.kubevirt.io/version: v0.12.4

Comment 9 errata-xmlrpc 2021-03-10 11:16:31 UTC
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 (Moderate: OpenShift Virtualization 2.6.0 security and bug fix update), 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-2021:0799


Note You need to log in before you can comment on or make changes to this bug.