Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherry-pick for release 1.10] Fix PodTopologySpread & NodePort in predicate #3896

Open
wants to merge 1 commit into
base: release-1.10
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading