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:
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
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.
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
Reassigning to Vatsal because Karel is on PTO
This got merged upstream https://github.com/kubevirt/ssp-operator/pull/71
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
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