Bug 2061723 - Prevent new DataImportCron to manage DataSource if multiple DataImportCron pointing to same DataSource
Summary: Prevent new DataImportCron to manage DataSource if multiple DataImportCron po...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Arnon Gilboa
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-08 12:11 UTC by Yan Du
Modified: 2023-11-13 08:14 UTC (History)
3 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2295 0 None Merged Reconcile DIC only if DataSource is not managed by another DIC 2022-06-06 10:22:48 UTC
Github kubevirt containerized-data-importer pull 2313 0 None Merged [release-v1.49] Reconcile DIC only if DataSource is not managed by another DIC 2022-06-06 13:47:00 UTC
Red Hat Issue Tracker CNV-16789 0 None None None 2023-11-13 08:14:27 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:29:25 UTC

Description Yan Du 2022-03-08 12:11:08 UTC
Description of problem:
Prevent DataSource being managed by other DataImportCron if multiple DataImportCron pointing to same DataSource

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

How reproducible:
Always

Steps to Reproduce:
1. Create two dataimportcrons pointing to same datasource
$ oc get dic
NAME                       AGE
rhel8-image-import-cron    35m
rhel8-image-import-cron2   29m


Actual results:
The datasource is managed by the second dic
$ oc get das -o yaml
apiVersion: v1
items:
- apiVersion: cdi.kubevirt.io/v1beta1
  kind: DataSource
  metadata:
    creationTimestamp: "2022-03-08T11:33:27Z"
    generation: 4
    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.0
      cdi.kubevirt.io/dataImportCron: rhel8-image-import-cron2  <====
    name: rhel8
    namespace: default
    resourceVersion: "8762731"
    uid: a7ae4b44-4357-4a9b-8f08-d1bb5221bf76
  spec:
    source:
      pvc:
        name: rhel8-67f0ea617157
        namespace: default
  status:
    conditions:
    - lastHeartbeatTime: "2022-03-08T11:34:56Z"
      lastTransitionTime: "2022-03-08T11:34:56Z"
      message: DataSource is ready to be consumed
      reason: Ready
      status: "True"
      type: Ready
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""


Expected results:
Got some warning message that prevent two dic point to same datasource

Additional info:

Comment 1 Maya Rashish 2022-06-07 00:24:16 UTC
Picked version of wrong thing, now corrected.

Comment 2 Yan Du 2022-06-10 05:25:19 UTC
Test on CNV-v4.11.0-456

DataSource is only managed by the first DataImportCron when creating multiple DataImportCrons point to the same datasource.
$ oc get dic
NAME                       AGE
rhel8-image-import-cron    4m12s
rhel8-image-import-cron2   3m34s
rhel8-image-import-cron3   2m9s

$ oc get das -o yaml
apiVersion: v1
items:
- apiVersion: cdi.kubevirt.io/v1beta1
  kind: DataSource
  metadata:
    creationTimestamp: "2022-06-10T05:20:32Z"
    generation: 4
    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.11.0
      cdi.kubevirt.io/dataImportCron: rhel8-image-import-cron

Comment 5 errata-xmlrpc 2022-09-14 19:29:09 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.