Skip to content

Commit

Permalink
CA: use ForceSchedulePod() instead of SchedulePod() in filterOutExpen…
Browse files Browse the repository at this point in the history
…dable

This is done to preserve the previous behavior - the predicates weren't
checked here before the refactor.

We need to figure out how to integrate this with DRA - left a TODO.
  • Loading branch information
towca committed Nov 14, 2024
1 parent dff1b6b commit ed9232e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func (p *filterOutExpendable) Process(context *context.AutoscalingContext, pods
// CA logic from before migration to scheduler framework. So let's keep it for now
func (p *filterOutExpendable) addPreemptingPodsToSnapshot(pods []*apiv1.Pod, ctx *context.AutoscalingContext) error {
for _, p := range pods {
if err := ctx.ClusterSnapshot.SchedulePod(p, p.Status.NominatedNodeName); err != nil {
// TODO(DRA): Figure out if/how to use the predicate-checking SchedulePod() here instead - otherwise this doesn't work with DRA pods.
if err := ctx.ClusterSnapshot.ForceSchedulePod(p, p.Status.NominatedNodeName); err != nil {
klog.Errorf("Failed to update snapshot with pod %s/%s waiting for preemption: %v", p.Namespace, p.Name, err)
return caerrors.ToAutoscalerError(caerrors.InternalError, err)
}
Expand Down

0 comments on commit ed9232e

Please sign in to comment.