Skip to content

Commit 8f0c329

Browse files
committed
cleanup: update invalid comments in plugin of InterPodAffinity
Signed-off-by: Dave Chen <[email protected]>
1 parent 15e95e4 commit 8f0c329

File tree

1 file changed

+2
-3
lines changed
  • pkg/scheduler/framework/plugins/interpodaffinity

1 file changed

+2
-3
lines changed

pkg/scheduler/framework/plugins/interpodaffinity/scoring.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error)
212212
}
213213

214214
// Score invoked at the Score extension point.
215-
// The "score" returned in this function is the matching number of pods on the `nodeName`,
215+
// The "score" returned in this function is the sum of weights got from cycleState which have its topologyKey matching with the node's labels.
216216
// it is normalized later.
217+
// Note: the returned "score" is positive for pod-affinity, and negative for pod-antiaffinity.
217218
func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
218219
nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName)
219220
if err != nil || nodeInfo.Node() == nil {
@@ -236,8 +237,6 @@ func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.Cyc
236237
}
237238

238239
// NormalizeScore normalizes the score for each filteredNode.
239-
// The basic rule is: the bigger the score(matching number of pods) is, the smaller the
240-
// final normalized score will be.
241240
func (pl *InterPodAffinity) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
242241
s, err := getPreScoreState(cycleState)
243242
if err != nil {

0 commit comments

Comments
 (0)