scheduler(NodeResourcesFit & NodeResourcesBalancedAllocation): calculatePodResourceRequest in PreScore phase (#115655)
* scheduler(NodeResourcesFit): calculatePodResourceRequest in PreScore phase * scheduler(NodeResourcesFit and NodeResourcesBalancedAllocation): calculatePodResourceRequest in PreScore phase * modify the comments and tests. * revert the tests. * don't need consider nodes. * use list instead of map. * add comment for podRequests. * avoid using negative wording in variable names.
This commit is contained in:
@@ -407,11 +407,16 @@ func TestLeastAllocatedScoringStrategy(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
status := p.(framework.PreScorePlugin).PreScore(ctx, state, test.requestedPod, test.nodes)
|
||||
if !status.IsSuccess() {
|
||||
t.Errorf("PreScore is expected to return success, but didn't. Got status: %v", status)
|
||||
}
|
||||
|
||||
var gotScores framework.NodeScoreList
|
||||
for _, n := range test.nodes {
|
||||
score, status := p.(framework.ScorePlugin).Score(ctx, state, test.requestedPod, n.Name)
|
||||
if status.Code() != test.wantStatusCode {
|
||||
t.Errorf("unexpected status code, want: %v, got: %v", test.wantStatusCode, status)
|
||||
t.Errorf("unexpected status code, want: %v, got: %v", test.wantStatusCode, status.Code())
|
||||
}
|
||||
gotScores = append(gotScores, framework.NodeScore{Name: n.Name, Score: score})
|
||||
}
|
||||
|
Reference in New Issue
Block a user