mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Rename schedulingPlugin -> schedulerPlugin
This commit is contained in:
parent
518a7d5f3b
commit
85b64391df
@ -336,7 +336,7 @@ type PluginConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewPlugin(c *PluginConfig) PluginInterface {
|
func NewPlugin(c *PluginConfig) PluginInterface {
|
||||||
return &schedulingPlugin{
|
return &schedulerPlugin{
|
||||||
config: c.Config,
|
config: c.Config,
|
||||||
api: c.api,
|
api: c.api,
|
||||||
client: c.client,
|
client: c.client,
|
||||||
@ -346,7 +346,7 @@ func NewPlugin(c *PluginConfig) PluginInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type schedulingPlugin struct {
|
type schedulerPlugin struct {
|
||||||
config *plugin.Config
|
config *plugin.Config
|
||||||
api schedapi.SchedulerApi
|
api schedapi.SchedulerApi
|
||||||
client *client.Client
|
client *client.Client
|
||||||
@ -355,14 +355,14 @@ type schedulingPlugin struct {
|
|||||||
starting chan struct{}
|
starting chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *schedulingPlugin) Run(done <-chan struct{}) {
|
func (s *schedulerPlugin) Run(done <-chan struct{}) {
|
||||||
defer close(s.starting)
|
defer close(s.starting)
|
||||||
go runtime.Until(s.scheduleOne, pluginRecoveryDelay, done)
|
go runtime.Until(s.scheduleOne, pluginRecoveryDelay, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
// hacked from GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/mesos_scheduler.go,
|
// hacked from GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/mesos_scheduler.go,
|
||||||
// with the Modeler stuff removed since we don't use it because we have mesos.
|
// with the Modeler stuff removed since we don't use it because we have mesos.
|
||||||
func (s *schedulingPlugin) scheduleOne() {
|
func (s *schedulerPlugin) scheduleOne() {
|
||||||
pod := s.config.NextPod()
|
pod := s.config.NextPod()
|
||||||
|
|
||||||
// pods which are pre-scheduled (i.e. NodeName is set) are deleted by the kubelet
|
// pods which are pre-scheduled (i.e. NodeName is set) are deleted by the kubelet
|
||||||
@ -409,7 +409,7 @@ func (s *schedulingPlugin) scheduleOne() {
|
|||||||
// host="..." | host="..." ; perhaps no updates to process?
|
// host="..." | host="..." ; perhaps no updates to process?
|
||||||
//
|
//
|
||||||
// TODO(jdef) this needs an integration test
|
// TODO(jdef) this needs an integration test
|
||||||
func (s *schedulingPlugin) reconcileTask(t *podtask.T) {
|
func (s *schedulerPlugin) reconcileTask(t *podtask.T) {
|
||||||
log.V(1).Infof("reconcile pod %v, assigned to slave %q", t.Pod.Name, t.Spec.AssignedSlave)
|
log.V(1).Infof("reconcile pod %v, assigned to slave %q", t.Pod.Name, t.Spec.AssignedSlave)
|
||||||
ctx := api.WithNamespace(api.NewDefaultContext(), t.Pod.Namespace)
|
ctx := api.WithNamespace(api.NewDefaultContext(), t.Pod.Namespace)
|
||||||
pod, err := s.client.Pods(api.NamespaceValue(ctx)).Get(t.Pod.Name)
|
pod, err := s.client.Pods(api.NamespaceValue(ctx)).Get(t.Pod.Name)
|
||||||
|
@ -425,7 +425,7 @@ type lifecycleTest struct {
|
|||||||
apiServer *TestServer
|
apiServer *TestServer
|
||||||
driver *joinableDriver
|
driver *joinableDriver
|
||||||
eventObs *EventObserver
|
eventObs *EventObserver
|
||||||
plugin *schedulingPlugin
|
plugin *schedulerPlugin
|
||||||
podsListWatch *MockPodsListWatch
|
podsListWatch *MockPodsListWatch
|
||||||
scheduler *MesosScheduler
|
scheduler *MesosScheduler
|
||||||
schedulerProc *ha.SchedulerProcess
|
schedulerProc *ha.SchedulerProcess
|
||||||
@ -491,7 +491,7 @@ func newLifecycleTest(t *testing.T) lifecycleTest {
|
|||||||
config.Recorder = eventObs
|
config.Recorder = eventObs
|
||||||
|
|
||||||
// create plugin
|
// create plugin
|
||||||
plugin := NewPlugin(config).(*schedulingPlugin)
|
plugin := NewPlugin(config).(*schedulerPlugin)
|
||||||
assert.NotNil(plugin)
|
assert.NotNil(plugin)
|
||||||
|
|
||||||
// create mock mesos scheduler driver
|
// create mock mesos scheduler driver
|
||||||
|
Loading…
Reference in New Issue
Block a user