Skip to content

Commit

Permalink
Fix VMware scheduler test (#1094)
Browse files Browse the repository at this point in the history
Now we allow migrating with more disks than the MaxInFlight in case
there is no VM being migrated at that time. This is done for the user's
convenience.

Related to: #1087

Signed-off-by: Martin Necas <[email protected]>
  • Loading branch information
mnecas committed Oct 10, 2024
1 parent a387e6b commit 100bbea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/plan/scheduler/vsphere/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/plan/scheduler/vsphere/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ func TestScheduler(t *testing.T) {
},
},
hostC: {
{
cost: 11,
},
{
cost: 1,
},
Expand Down

0 comments on commit 100bbea

Please sign in to comment.