Skip to content

Commit

Permalink
adapt to new PreScore() interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Huang-Wei committed Aug 18, 2024
1 parent 6022686 commit 67300af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func New(_ context.Context, obj runtime.Object, handle framework.Handle) (framew
}

// PreScore : calculate pod requests and limits and store as plugin state data to be used during scoring
func (pl *LowRiskOverCommitment) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status {
func (pl *LowRiskOverCommitment) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*framework.NodeInfo) *framework.Status {
klog.V(6).InfoS("PreScore: Calculating pod resource requests and limits", "pod", klog.KObj(pod))
podResourcesStateData := CreatePodResourcesStateData(pod)
cycleState.Write(PodResourcesKey, podResourcesStateData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestLowRiskOverCommitment_Score(t *testing.T) {
p, _ := New(ctx, &lowRiskOverCommitmentArgs, fh)

preScorePlugin := p.(framework.PreScorePlugin)
status := preScorePlugin.PreScore(context.Background(), state, tt.pod, tt.nodes)
status := preScorePlugin.PreScore(context.Background(), state, tt.pod, tf.BuildNodeInfos(tt.nodes))
assert.True(t, status.IsSuccess())

scorePlugin := p.(framework.ScorePlugin)
Expand Down

0 comments on commit 67300af

Please sign in to comment.