Skip to content

Commit 068c69d

Browse files
committed
Skip PreScore when the TopologySpreadConstraints is specified
`DefaultPodTopologySpread` need't score when the `TopologySpreadConstraints` is specified. `PreScore` needn't do this as well, this cut off the cost of `PreScore` if possible. Signed-off-by: Dave Chen <[email protected]>
1 parent cf36d9b commit 068c69d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/scheduler/framework/plugins/defaultpodtopologyspread/default_pod_topology_spread.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ func (pl *DefaultPodTopologySpread) ScoreExtensions() framework.ScoreExtensions
171171

172172
// PreScore builds and writes cycle state used by Score and NormalizeScore.
173173
func (pl *DefaultPodTopologySpread) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status {
174+
if skipDefaultPodTopologySpread(pod) {
175+
return nil
176+
}
174177
var selector labels.Selector
175178
informerFactory := pl.handle.SharedInformerFactory()
176179
selector = helper.DefaultSelector(

0 commit comments

Comments
 (0)