Bug 2036605 - Auto-update boot sources: DataSource Ready status is not updated if there's no DataImportCron associated with it
Summary: Auto-update boot sources: DataSource Ready status is not updated if there's n...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 4.10.0
Assignee: Arnon Gilboa
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-03 11:11 UTC by Ruth Netser
Modified: 2022-03-16 16:05 UTC (History)
6 users (show)

Fixed In Version: CNV v4.10.0-605
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-16 16:05:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 2085 0 None Merged Add DataSource controller to update the Ready condition 2022-01-09 10:38:03 UTC
Github kubevirt containerized-data-importer pull 2095 0 None Merged Update DataSource Ready condition on DV update 2022-01-19 09:50:49 UTC
Red Hat Issue Tracker CNV-15562 0 None None None 2022-01-17 09:49:33 UTC
Red Hat Product Errata RHSA-2022:0947 0 None Closed RHEL EUS Errata Documentation 2022-06-16 06:26:55 UTC

Description Ruth Netser 2022-01-03 11:11:34 UTC
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:

Comment 1 Yan Du 2022-01-12 09:41:07 UTC
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

Comment 2 Arnon Gilboa 2022-01-12 12:20:52 UTC
Yan, thanks for finding this one. Fixing it.

Comment 3 Yan Du 2022-01-21 13:33:51 UTC
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

Comment 8 errata-xmlrpc 2022-03-16 16:05:38 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 (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


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