Description of problem: DataSource Ready status is updated only when there is a DataImportCron managing it. When there is no DataImportCron associated, DataSource will be outdated. For example - when the referred PVC is deleted, or when the DataSource is manually updated to point to another PVC or to nil. Version-Release number of selected component (if applicable): CNV 4.10.0 How reproducible: 100% Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Test failed on CNV v4.10.0-581 steps: 1. $ oc new-project test 2. $ oc import-image rhel8-is -n test --from=registry.redhat.io/rhel8/rhel-guest-image --scheduled --confirm 3. $ oc create -f dic.yaml --- apiVersion: cdi.kubevirt.io/v1beta1 kind: DataImportCron metadata: name: rhel8-image-import-cron spec: template: spec: source: registry: imageStream: rhel8-is pullMethod: node storage: resources: requests: storage: 10Gi storageClassName: ocs-storagecluster-ceph-rbd schedule: "* * * * *" importsToKeep: 1 managedDataSource: rhel8 4. Wait the pvc bound and dv import finished $ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE rhel8-2325b0922721 Bound pvc-d66c7b24-7402-49fb-94bd-78ee75ae3d43 10Gi RWX ocs-storagecluster-ceph-rbd 52s $ oc get dv NAME PHASE PROGRESS RESTARTS AGE rhel8-2325b0922721 Succeeded 100.0% 81s 5. Check the datasource spec: source: pvc: name: rhel8-2325b0922721 namespace: test status: conditions: - lastHeartbeatTime: "2022-01-12T09:08:02Z" lastTransitionTime: "2022-01-12T09:08:02Z" message: DataSource is ready to be consumed reason: Ready status: "True" type: Ready 6. Delete the dataimportcron $ oc delete dic rhel8-image-import-cron dataimportcron.cdi.kubevirt.io "rhel8-image-import-cron" deleted 7. Delete the dv and pvc $ oc get pvc No resources found in test namespace. $ oc get dv No resources found in test namespace. 8. Check the datasource, the datasouorce is still pointing to the pvc(rhel8-2325b0922721) which is already deleted and will not update. $ oc get das -o yaml apiVersion: v1 items: - apiVersion: cdi.kubevirt.io/v1beta1 kind: DataSource metadata: creationTimestamp: "2022-01-12T09:06:47Z" generation: 16 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-cron name: rhel8 namespace: test resourceVersion: "1889157" uid: 89ed491a-6c40-4cf7-8280-b2fa3d25510e spec: source: pvc: name: rhel8-2325b0922721 namespace: test status: conditions: - lastHeartbeatTime: "2022-01-12T09:21:09Z" lastTransitionTime: "2022-01-12T09:21:09Z" message: DataSource is ready to be consumed reason: Ready status: "True" type: Ready
Yan, thanks for finding this one. Fixing it.
Test on CNV v4.10.0-605, issue has been fixed. Got DV not found in conditions when the daimportcron/DV/PVC do not exist status: conditions: - lastHeartbeatTime: "2022-01-21T13:28:15Z" lastTransitionTime: "2022-01-21T13:28:15Z" message: DataVolume not found reason: NotFound status: "False" type: Ready
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 4.10.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:0947