Skip to content

Commit c9fda7a

Browse files
committed
move bindVolumes behind RunPermitPlugins
1 parent 35cfd32 commit c9fda7a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pkg/scheduler/scheduler.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -695,18 +695,6 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
695695
metrics.SchedulerGoroutines.WithLabelValues("binding").Inc()
696696
defer metrics.SchedulerGoroutines.WithLabelValues("binding").Dec()
697697

698-
// Bind volumes first before Pod
699-
if !allBound {
700-
err := sched.bindVolumes(assumedPod)
701-
if err != nil {
702-
sched.recordSchedulingFailure(assumedPodInfo, err, "VolumeBindingFailed", err.Error())
703-
metrics.PodScheduleErrors.Inc()
704-
// trigger un-reserve plugins to clean up state associated with the reserved Pod
705-
fwk.RunUnreservePlugins(bindingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)
706-
return
707-
}
708-
}
709-
710698
// Run "permit" plugins.
711699
permitStatus := fwk.RunPermitPlugins(bindingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)
712700
if !permitStatus.IsSuccess() {
@@ -727,6 +715,18 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
727715
return
728716
}
729717

718+
// Bind volumes first before Pod
719+
if !allBound {
720+
err := sched.bindVolumes(assumedPod)
721+
if err != nil {
722+
sched.recordSchedulingFailure(assumedPodInfo, err, "VolumeBindingFailed", err.Error())
723+
metrics.PodScheduleErrors.Inc()
724+
// trigger un-reserve plugins to clean up state associated with the reserved Pod
725+
fwk.RunUnreservePlugins(bindingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)
726+
return
727+
}
728+
}
729+
730730
// Run "prebind" plugins.
731731
preBindStatus := fwk.RunPreBindPlugins(bindingCycleCtx, state, assumedPod, scheduleResult.SuggestedHost)
732732
if !preBindStatus.IsSuccess() {

0 commit comments

Comments
 (0)