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:
Picked version of wrong thing, now corrected.
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
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