Bug 2088472 - Golden Images import cron jobs are not getting updated on upgrade to 4.11
Summary: Golden Images import cron jobs are not getting updated on upgrade to 4.11
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.11.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.11.0
Assignee: Arnon Gilboa
QA Contact: Yan Du
URL:
Whiteboard:
Depends On: 2102349
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-19 14:11 UTC by Oren Cohen
Modified: 2023-11-13 08:11 UTC (History)
4 users (show)

Fixed In Version: CNV v4.11.0-478
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 19:34:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2316 0 None Merged Update DataImportCron CronJob when needed 2022-06-13 12:18:13 UTC
Github kubevirt containerized-data-importer pull 2318 0 None Merged [release-v1.49] Update DataImportCron CronJob if needed 2022-06-14 07:47:17 UTC
Red Hat Issue Tracker CNV-18498 0 None None None 2023-11-13 08:11:19 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:34:35 UTC

Description Oren Cohen 2022-05-19 14:11:47 UTC
Description of problem:
When CNV is being upgraded from 4.10 to 4.11, the CronJobs resources are staying the same as in 4.10, and referring to virt-cdi-importer image of the previous version, rather than the current (upgraded) one.

$ oc get csv
NAME                                       DISPLAY                                          VERSION   REPLACES                                   PHASE
kubevirt-hyperconverged-operator.v4.11.0   OpenShift Virtualization                         4.11.0    kubevirt-hyperconverged-operator.v4.10.1   Succeeded

$ oc get clusterversion
NAME      VERSION                         AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-0.ci-2022-05-16-202609   True        False         19h     Cluster version is 4.11.0-0.ci-2022-05-16-202609


$ oc get cj centos-stream8-image-cron-ccd4c750 -o yaml
apiVersion: batch/v1
kind: CronJob
metadata:
  creationTimestamp: "2022-05-12T15:48:20Z"
  generation: 1
  labels:
    app.kubernetes.io/component: storage
    app.kubernetes.io/managed-by: cdi-controller
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.10.1                       # <-- NOTE THE VERSION WASN'T UPDATED
    cdi.kubevirt.io/dataImportCron: openshift-virtualization-os-images.centos-stream8-image-cron
  name: centos-stream8-image-cron-ccd4c750
  namespace: openshift-cnv
  ownerReferences:
  - apiVersion: cdi.kubevirt.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: CDI
    name: cdi-kubevirt-hyperconverged
    uid: a3cdcb47-33ab-493d-9d72-a6e14c35201f
  resourceVersion: "15783003"
  uid: c7a5151c-433c-4b87-94e4-e94aa7e53cd3
spec:
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 0
  jobTemplate:
    metadata:
      creationTimestamp: null
    spec:
      backoffLimit: 2
      template:
        metadata:
          creationTimestamp: null
        spec:
          containers:
          - command:
            - /usr/bin/cdi-source-update-poller
            - -ns
            - openshift-virtualization-os-images
            - -cron
            - centos-stream8-image-cron
            - -url
            - docker://quay.io/containerdisks/centos-stream:8
            image: registry.redhat.io/container-native-virtualization/virt-cdi-importer@sha256:218f34e846ce4bcede87261d712bf130f6158b405b443cdf6491026d12f1f348   # <-- this refers to an 4.10.1 image.
            imagePullPolicy: IfNotPresent
            name: cdi-source-update-poller
            resources: {}
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
          dnsPolicy: ClusterFirst
          restartPolicy: Never
          schedulerName: default-scheduler
          securityContext: {}
          serviceAccount: cdi-cronjob
          serviceAccountName: cdi-cronjob
          terminationGracePeriodSeconds: 0
      ttlSecondsAfterFinished: 0
  schedule: 24 5/12 * * *
  successfulJobsHistoryLimit: 0
  suspend: false
status:
  lastScheduleTime: "2022-05-19T05:24:00Z"


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

How reproducible:
Always

Steps to Reproduce:
1. Install CNV 4.10.1 with enableCommonBootImageImport feature gate enabled.
2. Upgrade to CNV 4.11.0
3. Note that all CronJob resources in openshift-cnv namespace are the same as in 4.10.1

Actual results:
DataImport CronJobs are using old version of virt-cdi-importer image.

Expected results:
The CronJobs should be refreshed on upgrade by CDI, referring to virt-cdi-importer image shipped in the upgraded version.

Additional info:

Comment 3 Yan Du 2022-07-12 02:22:23 UTC
After upgrade CNV v4.10 to CNV v4.11.0-560, all the cronjobs are updated to 4.11 image (virt-cdi-importer-container-v4.11.0-59)

apiVersion: batch/v1
kind: CronJob
----------------------8<-----------------------
    app.kubernetes.io/component: storage
    app.kubernetes.io/managed-by: cdi-controller
    app.kubernetes.io/part-of: hyperconverged-cluster
    app.kubernetes.io/version: 4.11.0
    cdi.kubevirt.io/dataImportCron: openshift-virtualization-os-images.centos-stream8-image-cron
  name: centos-stream8-image-cron-49e5e706
  namespace: openshift-cnv
  ownerReferences:
  - apiVersion: cdi.kubevirt.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: CDI
    name: cdi-kubevirt-hyperconverged
    uid: 99478e82-bd72-4432-b36f-2ebf8c359ee4
  resourceVersion: "5815684"
  uid: bd00cb4e-71af-4eab-9982-e3072ed820b2
spec:
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 0
  jobTemplate:
    metadata:
      creationTimestamp: null
    spec:
      backoffLimit: 2
      template:
        metadata:
          creationTimestamp: null
        spec:
          containers:
          - command:
            - /usr/bin/cdi-source-update-poller
            - -ns
            - openshift-virtualization-os-images
            - -cron
            - centos-stream8-image-cron
            - -url
            - docker://quay.io/containerdisks/centos-stream:8
            image: registry.redhat.io/container-native-virtualization/virt-cdi-importer@sha256:3e67ebdde21b50407f5fd4b07347dcf0d9009a9deaeef377c0d0caa21e78e41a
            imagePullPolicy: IfNotPresent
            name: cdi-source-update-poller
----------------------8<-----------------------

Comment 6 errata-xmlrpc 2022-09-14 19:34:26 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 (Important: OpenShift Virtualization 4.11.0 Images 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-2022:6526


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