Skip to content

Commit

Permalink
Fix PodTopologySpread in predicate
Browse files Browse the repository at this point in the history
Signed-off-by: Box Zhang <[email protected]>
  • Loading branch information
bibibox committed Dec 16, 2024
1 parent 087d990 commit 0be4606
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/scheduler/plugins/predicates/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,12 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
status := nodePortFilter.Filter(context.TODO(), state, nil, nodeInfo)
nodePortStatus := api.ConvertPredicateStatus(status)
if nodePortStatus.Code != api.Success {
// TODO: Currently, preemption is not supported when NodePort filtering fails.
// Once supported, the logic here should be removed.
// See https://github.com/volcano-sh/volcano/issues/3845
nodePortStatus.Code = api.UnschedulableAndUnresolvable
predicateStatus = append(predicateStatus, nodePortStatus)
if ShouldAbort(nodePortStatus) {
return api.NewFitErrWithStatus(task, node, predicateStatus...)
}
return api.NewFitErrWithStatus(task, node, predicateStatus...)
}
}
}
Expand Down Expand Up @@ -539,10 +541,12 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
status := podTopologySpreadFilter.Filter(context.TODO(), state, task.Pod, nodeInfo)
podTopologyStatus := api.ConvertPredicateStatus(status)
if podTopologyStatus.Code != api.Success {
// TODO: Currently, preemption is not supported when Pod Topology Spread filtering fails.
// Once supported, the logic here should be removed.
// See https://github.com/volcano-sh/volcano/issues/3845
podTopologyStatus.Code = api.UnschedulableAndUnresolvable
predicateStatus = append(predicateStatus, podTopologyStatus)
if ShouldAbort(podTopologyStatus) {
return api.NewFitErrWithStatus(task, node, predicateStatus...)
}
return api.NewFitErrWithStatus(task, node, predicateStatus...)
}
}
}
Expand Down

0 comments on commit 0be4606

Please sign in to comment.