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..11221a2ed 100644 --- a/pkg/controller/plan/scheduler/vsphere/scheduler_test.go +++ b/pkg/controller/plan/scheduler/vsphere/scheduler_test.go @@ -84,7 +84,7 @@ func TestScheduler(t *testing.T) { }, hostC: { { - cost: 1, + cost: 11, }, { cost: 2,