Skip to content

Commit

Permalink
MTV-1627 | Fix the PVC search for the progress
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mnecas committed Nov 14, 2024
1 parent cc7c7e4 commit 0d911d6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/controller/plan/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0d911d6

Please sign in to comment.