Bug 1925019

Summary: Common Templates - after upgrade, "template.kubevirt.io/deprecated" annotation should be added to older templates versions
Product: Container Native Virtualization (CNV) Reporter: Ruth Netser <rnetser>
Component: SSPAssignee: Karel Šimon <ksimon>
Status: CLOSED ERRATA QA Contact: Israel Pinto <ipinto>
Severity: medium Docs Contact:
Priority: high    
Version: 2.6.0CC: cnv-qe-bugs, fdeutsch, ksimon, oyahud
Target Milestone: ---   
Target Release: 2.6.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubevirt-ssp-operator-container-v2.6.1-5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-04 20:09:13 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 Ruth Netser 2021-02-04 08:25:33 UTC
Description of problem:
After upgrade, older, deprecated templates may exist.
"template.kubevirt.io/deprecated" annotation should be added to these templates 

(completion to bug 1924583 and bug 1859235)

Version-Release number of selected component (if applicable):
CNV 2.5.3->2.6.0

How reproducible:
100%

Steps to Reproduce:
1. Upgrade from CNV 2.5.z - > 2.6.0


Actual results:
Some templates are deprecated.
While the os-flavor-workload labels are removed, "template.kubevirt.io/deprecated" annotation should be added as well.

Expected results:


Additional info:

Comment 1 Ruth Netser 2021-03-30 13:02:41 UTC
Tested with SSP operator v2.6.1-5.
Annotation is not added to templates after upgrade, for example fedora-highperformance-medium-v0.11.3:


  annotations:
    defaults.template.kubevirt.io/disk: rootdisk
    description: |-
      Template for Fedora 31 VM or newer. A PVC with the Fedora disk image must be available.
      Recommended disk image: https://download.fedoraproject.org/pub/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2
    iconClass: icon-fedora
    name.os.template.kubevirt.io/fedora31: Fedora 31 or higher
    name.os.template.kubevirt.io/fedora32: Fedora 31 or higher
    name.os.template.kubevirt.io/silverblue31: Fedora 31 or higher
    name.os.template.kubevirt.io/silverblue32: Fedora 31 or higher
    openshift.io/display-name: Fedora 31+ VM
    openshift.io/documentation-url: https://github.com/kubevirt/common-templates
    openshift.io/provider-display-name: KubeVirt
    openshift.io/support-url: https://github.com/kubevirt/common-templates/issues
    operator-sdk/primary-resource: openshift-cnv/ssp-kubevirt-hyperconverged
    operator-sdk/primary-resource-type: SSP.ssp.kubevirt.io
    tags: hidden,kubevirt,virtualmachine,fedora
    template.kubevirt.io/editable: |
      /objects[0].spec.template.spec.domain.cpu.sockets
      /objects[0].spec.template.spec.domain.cpu.cores
      /objects[0].spec.template.spec.domain.cpu.threads
      /objects[0].spec.template.spec.domain.resources.requests.memory
      /objects[0].spec.template.spec.domain.devices.disks
      /objects[0].spec.template.spec.volumes
      /objects[0].spec.template.spec.networks
    template.kubevirt.io/version: v1alpha1
    template.openshift.io/bindable: "false"
    validations: |
      [
        {
          "name": "minimal-required-memory",
          "path": "jsonpath::.spec.domain.resources.requests.memory",
          "rule": "integer",
          "message": "This VM requires more memory.",
          "min": 1073741824
        }
      ]

Comment 2 Fabian Deutsch 2021-03-31 14:16:23 UTC
We are moving this out to 2.6.2 as it's not urgent eoungh

Comment 3 Omer Yahud 2021-04-11 07:42:03 UTC
  
@ksimon I remember the PR was backported last week, can't this be moved to ON_QA?

Comment 4 Fabian Deutsch 2021-04-13 10:54:16 UTC
The PR got merged, moving to MODIFIED

Comment 5 Ruth Netser 2021-04-25 07:02:32 UTC
Verified with SSP v2.6.2-2.
Upgraded from 2.5.5 -> 2.6.0 - > 2.6.1 - > 2.6.2

Old templates have template.kubevirt.io/deprecated: "true"
New templates do not have the label.
The UI displays only active templates.

Comment 11 errata-xmlrpc 2021-05-04 20:09:13 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 (OpenShift Virtualization 2.6.2 Images), 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/RHEA-2021:1502