Description of problem: When trying to upload a dv/pvc via virtctl, and the pvc already exist but the dv was garbage collected, the wrong error message printed to screen. Version-Release number of selected component (if applicable): 4.13 How reproducible: 100% Steps to Reproduce: 1. Create a DV and wait for it to success: virtctl image-upload dv dv-name --size=18Gi --image-path=./Fedora... --block-volume --access-mode=ReadWriteOnce --storage-class=ocs-storagecluster-ceph-rbd --insecure 2. try to upload again: Actual results: error message: No DataVolume is associated with the existing PVC default/dv-name Expected results: error message: PVC dv-name already successfully imported/cloned/updated
Hey @dafrank I created this PR[1] to improve the error handling so it matches the expected results, but I think we first need some reviews to see if the team is happy with the change. I think we can't simply change the current error message to match the expected result since we don't know if the PVC exists due to an already garbage-collected DV or if it was just created with the same name. In the PR, I'm checking if the PVC contains the DeleteAfterCompletion annotation to determine if it was created by a DV or not. However, I'm also not 100% happy with that because the PVC could have been created by a completely different DV with the same name. I still think it's a good solution though. [1] https://github.com/kubevirt/kubevirt/pull/9445
Alvaro, could you please cherrypick the main branch PR?
Sure, thanks for noticing.
Test on CNV-v4.13.0.rhel9-2036 $ virtctl image-upload dv dv-name --size=18Gi --image-path=./Fedora... --block-volume --access-mode=ReadWriteOnce --storage-class=ocs-storagecluster-ceph-rbd --insecure DataVolume already garbage-collected: Assuming PVC default/dv-name is successfully populated
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.13.0 Images security, bug fix, and enhancement 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-2023:3205
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days