Skip to content

Commit

Permalink
scheduler: fix reservation restricted options (koordinator-sh#1926)
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph <joseph.t.lee@outlook.com>
  • Loading branch information
eahydra authored and ls-2018 committed Mar 25, 2024
1 parent 9d148bd commit b6c75b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/scheduler/plugins/reservation/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,11 @@ func (pl *Plugin) filterWithReservations(ctx context.Context, cycleState *framew
allocated := rInfo.Allocated
if len(preemptibleInRR) > 0 {
allocated = quotav1.SubtractWithNonNegativeResult(allocated, preemptibleInRR)
allocated = quotav1.Mask(allocated, rInfo.ResourceNames)
}
allocated = quotav1.Mask(allocated, rInfo.ResourceNames)
rRemained := quotav1.SubtractWithNonNegativeResult(rInfo.Allocatable, allocated)
fits, _ := quotav1.LessThanOrEqual(state.podRequests, rRemained)
requests := quotav1.Mask(state.podRequests, rInfo.ResourceNames)
fits, _ := quotav1.LessThanOrEqual(requests, rRemained)
if fits && nodeFits {
hasSatisfiedReservation = true
break
Expand Down

0 comments on commit b6c75b3

Please sign in to comment.