From 0d911d623d86abd8c389c6c6dcfb8a63e5126942 Mon Sep 17 00:00:00 2001 From: Martin Necas Date: Mon, 4 Nov 2024 13:57:59 +0100 Subject: [PATCH] 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 --- pkg/controller/plan/migration.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pkg/controller/plan/migration.go b/pkg/controller/plan/migration.go index 4eb2f2e21..64d5121d9 100644 --- a/pkg/controller/plan/migration.go +++ b/pkg/controller/plan/migration.go @@ -1622,8 +1622,23 @@ func (r *Migration) updateCopyProgress(vm *plan.VMStatus, step *plan.Step) (err path.Join(dv.Namespace, dv.Name)) continue } + primePvc := &core.PersistentVolumeClaim{} + err = r.Destination.Client.Get(context.TODO(), types.NamespacedName{ + Namespace: r.Plan.Spec.TargetNamespace, + Name: fmt.Sprintf("prime-%s", pvc.UID), + }, primePvc) + if err != nil { + log.Error( + err, + "Could not get prime PVC for DataVolume.", + "vm", + vm.String(), + "dv", + path.Join(dv.Namespace, dv.Name)) + continue + } - importer, found, kErr = r.kubevirt.GetImporterPod(*pvc) + importer, found, kErr = r.kubevirt.GetImporterPod(*primePvc) } if kErr != nil {