move nodeinfo type to framework pkg
This commit is contained in:
@@ -32,9 +32,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/controller/volume/scheduling"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
|
||||
schedulerlisters "k8s.io/kubernetes/pkg/scheduler/listers"
|
||||
"k8s.io/kubernetes/pkg/scheduler/metrics"
|
||||
schedulertypes "k8s.io/kubernetes/pkg/scheduler/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -60,7 +58,7 @@ const (
|
||||
// plugins.
|
||||
type framework struct {
|
||||
registry Registry
|
||||
snapshotSharedLister schedulerlisters.SharedLister
|
||||
snapshotSharedLister SharedLister
|
||||
waitingPods *waitingPodsMap
|
||||
pluginNameToWeightMap map[string]int
|
||||
queueSortPlugins []QueueSortPlugin
|
||||
@@ -116,7 +114,7 @@ func (f *framework) getExtensionPoints(plugins *config.Plugins) []extensionPoint
|
||||
type frameworkOptions struct {
|
||||
clientSet clientset.Interface
|
||||
informerFactory informers.SharedInformerFactory
|
||||
snapshotSharedLister schedulerlisters.SharedLister
|
||||
snapshotSharedLister SharedLister
|
||||
metricsRecorder *metricsRecorder
|
||||
volumeBinder scheduling.SchedulerVolumeBinder
|
||||
runAllFilters bool
|
||||
@@ -140,7 +138,7 @@ func WithInformerFactory(informerFactory informers.SharedInformerFactory) Option
|
||||
}
|
||||
|
||||
// WithSnapshotSharedLister sets the SharedLister of the snapshot.
|
||||
func WithSnapshotSharedLister(snapshotSharedLister schedulerlisters.SharedLister) Option {
|
||||
func WithSnapshotSharedLister(snapshotSharedLister SharedLister) Option {
|
||||
return func(o *frameworkOptions) {
|
||||
o.snapshotSharedLister = snapshotSharedLister
|
||||
}
|
||||
@@ -352,7 +350,7 @@ func (f *framework) RunPreFilterExtensionAddPod(
|
||||
state *CycleState,
|
||||
podToSchedule *v1.Pod,
|
||||
podToAdd *v1.Pod,
|
||||
nodeInfo *schedulertypes.NodeInfo,
|
||||
nodeInfo *NodeInfo,
|
||||
) (status *Status) {
|
||||
for _, pl := range f.preFilterPlugins {
|
||||
if pl.PreFilterExtensions() == nil {
|
||||
@@ -370,7 +368,7 @@ func (f *framework) RunPreFilterExtensionAddPod(
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *framework) runPreFilterExtensionAddPod(ctx context.Context, pl PreFilterPlugin, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *schedulertypes.NodeInfo) *Status {
|
||||
func (f *framework) runPreFilterExtensionAddPod(ctx context.Context, pl PreFilterPlugin, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *NodeInfo) *Status {
|
||||
if !state.ShouldRecordPluginMetrics() {
|
||||
return pl.PreFilterExtensions().AddPod(ctx, state, podToSchedule, podToAdd, nodeInfo)
|
||||
}
|
||||
@@ -388,7 +386,7 @@ func (f *framework) RunPreFilterExtensionRemovePod(
|
||||
state *CycleState,
|
||||
podToSchedule *v1.Pod,
|
||||
podToRemove *v1.Pod,
|
||||
nodeInfo *schedulertypes.NodeInfo,
|
||||
nodeInfo *NodeInfo,
|
||||
) (status *Status) {
|
||||
for _, pl := range f.preFilterPlugins {
|
||||
if pl.PreFilterExtensions() == nil {
|
||||
@@ -406,7 +404,7 @@ func (f *framework) RunPreFilterExtensionRemovePod(
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *framework) runPreFilterExtensionRemovePod(ctx context.Context, pl PreFilterPlugin, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *schedulertypes.NodeInfo) *Status {
|
||||
func (f *framework) runPreFilterExtensionRemovePod(ctx context.Context, pl PreFilterPlugin, state *CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *NodeInfo) *Status {
|
||||
if !state.ShouldRecordPluginMetrics() {
|
||||
return pl.PreFilterExtensions().RemovePod(ctx, state, podToSchedule, podToAdd, nodeInfo)
|
||||
}
|
||||
@@ -424,7 +422,7 @@ func (f *framework) RunFilterPlugins(
|
||||
ctx context.Context,
|
||||
state *CycleState,
|
||||
pod *v1.Pod,
|
||||
nodeInfo *schedulertypes.NodeInfo,
|
||||
nodeInfo *NodeInfo,
|
||||
) PluginToStatus {
|
||||
var firstFailedStatus *Status
|
||||
statuses := make(PluginToStatus)
|
||||
@@ -451,7 +449,7 @@ func (f *framework) RunFilterPlugins(
|
||||
return statuses
|
||||
}
|
||||
|
||||
func (f *framework) runFilterPlugin(ctx context.Context, pl FilterPlugin, state *CycleState, pod *v1.Pod, nodeInfo *schedulertypes.NodeInfo) *Status {
|
||||
func (f *framework) runFilterPlugin(ctx context.Context, pl FilterPlugin, state *CycleState, pod *v1.Pod, nodeInfo *NodeInfo) *Status {
|
||||
if !state.ShouldRecordPluginMetrics() {
|
||||
return pl.Filter(ctx, state, pod, nodeInfo)
|
||||
}
|
||||
@@ -817,7 +815,7 @@ func (f *framework) WaitOnPermit(ctx context.Context, pod *v1.Pod) (status *Stat
|
||||
// snapshot. The snapshot is taken at the beginning of a scheduling cycle and remains
|
||||
// unchanged until a pod finishes "Reserve". There is no guarantee that the information
|
||||
// remains unchanged after "Reserve".
|
||||
func (f *framework) SnapshotSharedLister() schedulerlisters.SharedLister {
|
||||
func (f *framework) SnapshotSharedLister() SharedLister {
|
||||
return f.snapshotSharedLister
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user