@@ -695,18 +695,6 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
695
695
metrics .SchedulerGoroutines .WithLabelValues ("binding" ).Inc ()
696
696
defer metrics .SchedulerGoroutines .WithLabelValues ("binding" ).Dec ()
697
697
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
-
710
698
// Run "permit" plugins.
711
699
permitStatus := fwk .RunPermitPlugins (bindingCycleCtx , state , assumedPod , scheduleResult .SuggestedHost )
712
700
if ! permitStatus .IsSuccess () {
@@ -727,6 +715,18 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
727
715
return
728
716
}
729
717
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
+
730
730
// Run "prebind" plugins.
731
731
preBindStatus := fwk .RunPreBindPlugins (bindingCycleCtx , state , assumedPod , scheduleResult .SuggestedHost )
732
732
if ! preBindStatus .IsSuccess () {
0 commit comments