mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-29 04:43:54 +00:00
Change all scheduler's Node and Pod list/lookups to be from the snapshot rather than the cache.
This commit is contained in:
@@ -21,10 +21,10 @@ import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/migration"
|
||||
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
||||
schedulerlisters "k8s.io/kubernetes/pkg/scheduler/listers"
|
||||
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
|
||||
)
|
||||
|
||||
@@ -54,8 +54,8 @@ func (pl *InterPodAffinity) Filter(ctx context.Context, cycleState *framework.Cy
|
||||
}
|
||||
|
||||
// New initializes a new plugin and returns it.
|
||||
func New(nodeLister schedulerlisters.NodeLister, podLister schedulerlisters.PodLister) framework.Plugin {
|
||||
func New(_ *runtime.Unknown, h framework.FrameworkHandle) (framework.Plugin, error) {
|
||||
return &InterPodAffinity{
|
||||
predicate: predicates.NewPodAffinityPredicate(nodeLister, podLister),
|
||||
}
|
||||
predicate: predicates.NewPodAffinityPredicate(h.SnapshotSharedLister().NodeInfos(), h.SnapshotSharedLister().Pods()),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user