Merge pull request #113499 from kerthcet/cleanup/map-empty-judgement

Fix: resourceToWeightMap will never be nil here
This commit is contained in:
Kubernetes Prow Robot
2022-12-12 00:15:33 -08:00
committed by GitHub
3 changed files with 11 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ func (r *resourceAllocationScorer) score(
if node == nil {
return 0, framework.NewStatus(framework.Error, "node not found")
}
if r.resourceToWeightMap == nil {
if len(r.resourceToWeightMap) == 0 {
return 0, framework.NewStatus(framework.Error, "resources not found")
}