Skip to content

Commit 0d911d6

Browse files
committed
MTV-1627 | Fix the PVC search for the progress
Issue: When monitring the migration process the forklift requests the PVC from DV ClaimName. On top of that the forklift checks the Annotation "cdi.kubevirt.io/storage.import.importPodName". But this annotation is missing in the main PVC but is present in the prime pvc, which format is "prime-$UID_MAINPVC". This annotation points to the created pod which imports the volume. Fix: Search the prime PVC instead of the main PVC, so the forklift is able to check the importer pod status. Signed-off-by: Martin Necas <mnecas@redhat.com>
1 parent cc7c7e4 commit 0d911d6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pkg/controller/plan/migration.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,8 +1622,23 @@ func (r *Migration) updateCopyProgress(vm *plan.VMStatus, step *plan.Step) (err
16221622
path.Join(dv.Namespace, dv.Name))
16231623
continue
16241624
}
1625+
primePvc := &core.PersistentVolumeClaim{}
1626+
err = r.Destination.Client.Get(context.TODO(), types.NamespacedName{
1627+
Namespace: r.Plan.Spec.TargetNamespace,
1628+
Name: fmt.Sprintf("prime-%s", pvc.UID),
1629+
}, primePvc)
1630+
if err != nil {
1631+
log.Error(
1632+
err,
1633+
"Could not get prime PVC for DataVolume.",
1634+
"vm",
1635+
vm.String(),
1636+
"dv",
1637+
path.Join(dv.Namespace, dv.Name))
1638+
continue
1639+
}
16251640

1626-
importer, found, kErr = r.kubevirt.GetImporterPod(*pvc)
1641+
importer, found, kErr = r.kubevirt.GetImporterPod(*primePvc)
16271642
}
16281643

16291644
if kErr != nil {

0 commit comments

Comments
 (0)