diff --git a/pkg/controller/plan/scheduler/vsphere/scheduler.go b/pkg/controller/plan/scheduler/vsphere/scheduler.go index 6d59be80b..82cb722b8 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler.go @@ -226,9 +226,9 @@ func (r *Scheduler) cost(vm *model.VM, vmStatus *plan.VMStatus) int { func (r *Scheduler) finishedDisks(vmStatus *plan.VMStatus) int { var resp = 0 for _, step := range vmStatus.Pipeline { - if step.Name == "DiskTransfer" { + if step.Name == DiskTransfer { for _, task := range step.Tasks { - if task.Phase == "Completed" { + if task.Phase == Completed { resp += 1 } } diff --git a/pkg/controller/plan/scheduler/vsphere/scheduler_test.go b/pkg/controller/plan/scheduler/vsphere/scheduler_test.go index ffeef6fdc..8cba74b0b 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler_test.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler_test.go @@ -83,6 +83,9 @@ func TestScheduler(t *testing.T) { }, }, hostC: { + { + cost: 11, + }, { cost: 1, },