Skip to content

Commit

Permalink
Merge pull request #134 from sp-yduck/fix/127
Browse files Browse the repository at this point in the history
fix panic in scoring plugin
  • Loading branch information
sp-yduck authored Nov 18, 2023
2 parents bbcdd56 + 9baaef0 commit e46dba9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloud/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ func (s *Scheduler) RunFilterPlugins(ctx context.Context, state *framework.Cycle

func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleState, config api.VirtualMachineCreateOptions, nodes []*api.Node) (framework.NodeScoreList, *framework.Status) {
s.logger.Info("scoring proxmox node")
status := framework.NewStatus()
var scoresMap map[string](map[int]framework.NodeScore)
nodeInfos, err := framework.GetNodeInfoList(ctx, s.client)
if err != nil {
status := framework.NewStatus()
status.SetCode(1)
return nil, status
}
Expand All @@ -374,7 +374,7 @@ func (s *Scheduler) RunScorePlugins(ctx context.Context, state *framework.CycleS
result[i].Score += scoresMap[j][i].Score
}
}
return result, nil
return result, status
}

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

0 comments on commit e46dba9

Please sign in to comment.