Skip to content

Commit

Permalink
OVA: Change connection refuse check for virt-v2v vm configuretion server
Browse files Browse the repository at this point in the history
Signed-off-by: Bella Khizgiyaev <[email protected]>
  • Loading branch information
bkhizgiy committed May 21, 2024
1 parent be670da commit 159ac1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/plan/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"sort"
"strconv"
"strings"
"syscall"
"time"

api "github.com/konveyor/forklift-controller/pkg/apis/forklift/v1beta1"
Expand Down Expand Up @@ -910,7 +909,7 @@ func (r *KubeVirt) UpdateVmByConvertedConfig(vm *plan.VMStatus, pod *core.Pod, s
*/
resp, err := http.Get(url)
if err != nil {
if err == syscall.ECONNREFUSED {
if strings.Contains(err.Error(), "connection refused") {
err = nil
}
return
Expand Down Expand Up @@ -941,6 +940,7 @@ func (r *KubeVirt) UpdateVmByConvertedConfig(vm *plan.VMStatus, pod *core.Pod, s
err = nil
}
}
step.MarkCompleted()
return
}

Expand Down
15 changes: 9 additions & 6 deletions pkg/controller/plan/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ func (r *Migration) execute(vm *plan.VMStatus) (err error) {
}
step.MarkStarted()
step.Phase = Running

err = r.updateConversionProgress(vm, step)
if err != nil {
return
}

// only for OVA, fetch config from the conversion pod
if r.Source.Provider.Type() == v1beta1.Ova {
pod, err := r.kubevirt.GetGuestConversionPod(vm)
Expand All @@ -1133,11 +1139,6 @@ func (r *Migration) execute(vm *plan.VMStatus) (err error) {
}
}

err = r.updateConversionProgress(vm, step)
if err != nil {
return
}

if step.MarkedCompleted() && !step.HasError() {
step.Phase = Completed
vm.Phase = r.next(vm.Phase)
Expand Down Expand Up @@ -1698,7 +1699,9 @@ func (r *Migration) updateConversionProgressEl9(pod *core.Pod, step *plan.Step)
if step.Name == ImageConversion && someProgress {
// Disk copying has already started. Transition from
// ConvertGuest to CopyDisksVirtV2V .
step.MarkCompleted()
if r.Source.Provider.Type() == v1beta1.VSphere {
step.MarkCompleted()
}
step.Progress.Completed = step.Progress.Total
return
}
Expand Down

0 comments on commit 159ac1d

Please sign in to comment.