Skip to content

Commit

Permalink
MTV-1627
Browse files Browse the repository at this point in the history
  • Loading branch information
mnecas committed Nov 23, 2024
1 parent b75f9ab commit ea33f03
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions pkg/controller/plan/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
k8serr "k8s.io/apimachinery/pkg/api/errors"
"net/http"
"path"
"regexp"
Expand Down Expand Up @@ -1626,23 +1627,29 @@ 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)
}, pvc)
if err != nil {
log.Error(
err,
"Could not get prime PVC for DataVolume.",
"vm",
vm.String(),
"dv",
path.Join(dv.Namespace, dv.Name))
continue
if k8serr.IsNotFound(err) {
log.Info("Could not find prime PVC")
// Ignore error
err = nil
} else {
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(*primePvc)
fmt.Println("pvc.Name")
fmt.Println(pvc.Name)
importer, found, kErr = r.kubevirt.GetImporterPod(*pvc)
}

if kErr != nil {
Expand Down

0 comments on commit ea33f03

Please sign in to comment.