mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 09:33:52 +00:00
Scheduler: skip updates of assumed pods
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/informers"
|
||||
coreinformers "k8s.io/client-go/informers/core/v1"
|
||||
@@ -639,14 +640,15 @@ func (sched *Scheduler) skipPodSchedule(fwk framework.Framework, pod *v1.Pod) bo
|
||||
return true
|
||||
}
|
||||
|
||||
// Case 2: pod has been assumed and pod updates could be skipped.
|
||||
// Case 2: pod has been assumed could be skipped.
|
||||
// An assumed pod can be added again to the scheduling queue if it got an update event
|
||||
// during its previous scheduling cycle but before getting assumed.
|
||||
if sched.skipPodUpdate(pod) {
|
||||
return true
|
||||
isAssumed, err := sched.SchedulerCache.IsAssumedPod(pod)
|
||||
if err != nil {
|
||||
utilruntime.HandleError(fmt.Errorf("failed to check whether pod %s/%s is assumed: %v", pod.Namespace, pod.Name, err))
|
||||
return false
|
||||
}
|
||||
|
||||
return false
|
||||
return isAssumed
|
||||
}
|
||||
|
||||
func defaultAlgorithmSourceProviderName() *string {
|
||||
|
Reference in New Issue
Block a user