Skip to content

Commit 9baaef0

Browse files
committed
fix panic in scoring plugin
1 parent 137744f commit 9baaef0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cloud/scheduler/scheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ func (s *Scheduler) RunFilterPlugins(ctx context.Context, state *framework.Cycle
348348

349349
func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleState, config api.VirtualMachineCreateOptions, nodes []*api.Node) (framework.NodeScoreList, *framework.Status) {
350350
s.logger.Info("scoring proxmox node")
351+
status := framework.NewStatus()
351352
var scoresMap map[string](map[int]framework.NodeScore)
352353
nodeInfos, err := framework.GetNodeInfoList(ctx, s.client)
353354
if err != nil {
354-
status := framework.NewStatus()
355355
status.SetCode(1)
356356
return nil, status
357357
}
@@ -374,7 +374,7 @@ func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleS
374374
result[i].Score += scoresMap[j][i].Score
375375
}
376376
}
377-
return result, nil
377+
return result, status
378378
}
379379

380380
func selectHighestScoreNode(scoreList framework.NodeScoreList) (string, error) {

0 commit comments

Comments
 (0)