From 9baaef025fabbd509ace4c954eafecce99c34b60 Mon Sep 17 00:00:00 2001 From: sp-yduck Date: Sat, 11 Nov 2023 11:08:57 +0900 Subject: [PATCH] fix panic in scoring plugin --- cloud/scheduler/scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/scheduler/scheduler.go b/cloud/scheduler/scheduler.go index 94fdb84..28f21fe 100644 --- a/cloud/scheduler/scheduler.go +++ b/cloud/scheduler/scheduler.go @@ -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 } @@ -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) {