mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
Fix broadcaster duplicate
This commit is contained in:
parent
182f49dac5
commit
a727188c19
@ -80,10 +80,8 @@ func NewScheduler(c *config.Config, fw framework.Framework, ps podschedulers.Pod
|
||||
binder := binder.NewBinder(core)
|
||||
|
||||
startLatch := make(chan struct{})
|
||||
eventBroadcaster := record.NewBroadcaster()
|
||||
|
||||
runtime.On(startLatch, func() {
|
||||
eventBroadcaster.StartRecordingToSink(client.Events(""))
|
||||
reflector.Run() // TODO(jdef) should listen for termination
|
||||
podDeleter.Run(updates, terminate)
|
||||
q.Run(terminate)
|
||||
|
@ -759,9 +759,12 @@ func (s *SchedulerServer) bootstrap(hks hyperkube.Interface, sc *schedcfg.Config
|
||||
},
|
||||
}
|
||||
|
||||
// create event recorder sending events to the "" namespace of the apiserver
|
||||
broadcaster := record.NewBroadcaster()
|
||||
recorder := broadcaster.NewRecorder(api.EventSource{Component: "scheduler"})
|
||||
broadcaster.StartRecordingToSink(client.Events(""))
|
||||
|
||||
// create scheduler loop
|
||||
eventBroadcaster := record.NewBroadcaster()
|
||||
recorder := eventBroadcaster.NewRecorder(api.EventSource{Component: "scheduler"})
|
||||
lw := cache.NewListWatchFromClient(client, "pods", api.NamespaceAll, fields.Everything())
|
||||
sched := components.NewScheduler(sc, framework, fcfs, client, recorder, schedulerProcess.Terminal(), s.mux, lw)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user