move nodeinfo/snapshot.go into its own package

This commit is contained in:
Abdullah Gharaibeh
2019-10-22 13:29:15 -04:00
parent a90b9402c9
commit 373cf8c1b1
16 changed files with 64 additions and 23 deletions

View File

@@ -33,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/metrics"
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
nodeinfosnapshot "k8s.io/kubernetes/pkg/scheduler/nodeinfo/snapshot"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
)
@@ -57,7 +58,7 @@ const (
// plugins.
type framework struct {
registry Registry
nodeInfoSnapshot *schedulernodeinfo.Snapshot
nodeInfoSnapshot *nodeinfosnapshot.Snapshot
waitingPods *waitingPodsMap
pluginNameToWeightMap map[string]int
queueSortPlugins []QueueSortPlugin
@@ -138,7 +139,7 @@ func NewFramework(r Registry, plugins *config.Plugins, args []config.PluginConfi
f := &framework{
registry: r,
nodeInfoSnapshot: schedulernodeinfo.NewSnapshot(),
nodeInfoSnapshot: nodeinfosnapshot.NewSnapshot(),
pluginNameToWeightMap: make(map[string]int),
waitingPods: newWaitingPodsMap(),
clientSet: options.clientSet,
@@ -594,7 +595,7 @@ func (f *framework) RunPermitPlugins(
// 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) NodeInfoSnapshot() *schedulernodeinfo.Snapshot {
func (f *framework) NodeInfoSnapshot() *nodeinfosnapshot.Snapshot {
return f.nodeInfoSnapshot
}