@@ -30,7 +30,6 @@ import (
30
30
"k8s.io/apimachinery/pkg/util/wait"
31
31
"k8s.io/client-go/informers"
32
32
infov1 "k8s.io/client-go/informers/core/v1"
33
- policyv1 "k8s.io/client-go/informers/policy/v1beta1"
34
33
schedv1 "k8s.io/client-go/informers/scheduling/v1beta1"
35
34
storagev1 "k8s.io/client-go/informers/storage/v1"
36
35
"k8s.io/client-go/kubernetes"
@@ -82,7 +81,6 @@ type SchedulerCache struct {
82
81
83
82
podInformer infov1.PodInformer
84
83
nodeInformer infov1.NodeInformer
85
- pdbInformer policyv1.PodDisruptionBudgetInformer
86
84
nsInformer infov1.NamespaceInformer
87
85
podGroupInformerV1alpha1 vcinformerv1.PodGroupInformer
88
86
podGroupInformerV1alpha2 vcinformerv2.PodGroupInformer
@@ -369,13 +367,6 @@ func newSchedulerCache(config *rest.Config, schedulerName string, defaultQueue s
369
367
},
370
368
})
371
369
372
- sc .pdbInformer = informerFactory .Policy ().V1beta1 ().PodDisruptionBudgets ()
373
- sc .pdbInformer .Informer ().AddEventHandler (cache.ResourceEventHandlerFuncs {
374
- AddFunc : sc .AddPDB ,
375
- UpdateFunc : sc .UpdatePDB ,
376
- DeleteFunc : sc .DeletePDB ,
377
- })
378
-
379
370
sc .pcInformer = informerFactory .Scheduling ().V1beta1 ().PriorityClasses ()
380
371
sc .pcInformer .Informer ().AddEventHandler (cache.ResourceEventHandlerFuncs {
381
372
AddFunc : sc .AddPriorityClass ,
@@ -428,7 +419,6 @@ func newSchedulerCache(config *rest.Config, schedulerName string, defaultQueue s
428
419
429
420
// Run starts the schedulerCache
430
421
func (sc * SchedulerCache ) Run (stopCh <- chan struct {}) {
431
- go sc .pdbInformer .Informer ().Run (stopCh )
432
422
go sc .podInformer .Informer ().Run (stopCh )
433
423
go sc .nodeInformer .Informer ().Run (stopCh )
434
424
go sc .podGroupInformerV1alpha1 .Informer ().Run (stopCh )
@@ -457,7 +447,6 @@ func (sc *SchedulerCache) WaitForCacheSync(stopCh <-chan struct{}) bool {
457
447
return cache .WaitForCacheSync (stopCh ,
458
448
func () []cache.InformerSynced {
459
449
informerSynced := []cache.InformerSynced {
460
- sc .pdbInformer .Informer ().HasSynced ,
461
450
sc .podInformer .Informer ().HasSynced ,
462
451
sc .podGroupInformerV1alpha1 .Informer ().HasSynced ,
463
452
sc .podGroupInformerV1alpha2 .Informer ().HasSynced ,
@@ -736,6 +725,7 @@ func (sc *SchedulerCache) Snapshot() *schedulingapi.ClusterInfo {
736
725
var wg sync.WaitGroup
737
726
738
727
cloneJob := func (value * schedulingapi.JobInfo ) {
728
+ defer wg .Done ()
739
729
if value .PodGroup != nil {
740
730
value .Priority = sc .defaultPriority
741
731
@@ -753,7 +743,6 @@ func (sc *SchedulerCache) Snapshot() *schedulingapi.ClusterInfo {
753
743
cloneJobLock .Lock ()
754
744
snapshot .Jobs [value .UID ] = clonedJob
755
745
cloneJobLock .Unlock ()
756
- wg .Done ()
757
746
}
758
747
759
748
for _ , value := range sc .NamespaceCollection {
@@ -765,7 +754,7 @@ func (sc *SchedulerCache) Snapshot() *schedulingapi.ClusterInfo {
765
754
766
755
for _ , value := range sc .Jobs {
767
756
// If no scheduling spec, does not handle it.
768
- if value .PodGroup == nil && value . PDB == nil {
757
+ if value .PodGroup == nil {
769
758
klog .V (4 ).Infof ("The scheduling spec of Job <%v:%s/%s> is nil, ignore it." ,
770
759
value .UID , value .Namespace , value .Name )
771
760
@@ -840,10 +829,9 @@ func (sc *SchedulerCache) RecordJobStatusEvent(job *schedulingapi.JobInfo) {
840
829
(job .PodGroup .Status .Phase == scheduling .PodGroupUnknown ||
841
830
job .PodGroup .Status .Phase == scheduling .PodGroupPending ||
842
831
job .PodGroup .Status .Phase == scheduling .PodGroupInqueue )
843
- pdbUnschedulabe := job .PDB != nil && len (job .TaskStatusIndex [schedulingapi .Pending ]) != 0
844
832
845
833
// If pending or unschedulable, record unschedulable event.
846
- if pgUnschedulable || pdbUnschedulabe {
834
+ if pgUnschedulable {
847
835
msg := fmt .Sprintf ("%v/%v tasks in gang unschedulable: %v" ,
848
836
len (job .TaskStatusIndex [schedulingapi .Pending ]),
849
837
len (job .Tasks ),
0 commit comments