From 8f0c32975894e35a35b1df8b3dd588bd762d7599 Mon Sep 17 00:00:00 2001 From: Dave Chen Date: Mon, 15 Jun 2020 10:36:38 +0800 Subject: [PATCH] cleanup: update invalid comments in plugin of InterPodAffinity Signed-off-by: Dave Chen --- pkg/scheduler/framework/plugins/interpodaffinity/scoring.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go index 5b70ab03442..5848121dee6 100644 --- a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go +++ b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go @@ -212,8 +212,9 @@ func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error) } // Score invoked at the Score extension point. -// The "score" returned in this function is the matching number of pods on the `nodeName`, +// The "score" returned in this function is the sum of weights got from cycleState which have its topologyKey matching with the node's labels. // it is normalized later. +// Note: the returned "score" is positive for pod-affinity, and negative for pod-antiaffinity. func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName) if err != nil || nodeInfo.Node() == nil { @@ -236,8 +237,6 @@ func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.Cyc } // NormalizeScore normalizes the score for each filteredNode. -// The basic rule is: the bigger the score(matching number of pods) is, the smaller the -// final normalized score will be. func (pl *InterPodAffinity) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status { s, err := getPreScoreState(cycleState) if err != nil {