Initialize scheduler cache with assigned non-terminated pods before scheduling.

This commit is contained in:
Klaus Ma
2017-05-07 13:45:02 +08:00
parent 20fa30e4b5
commit c78faec4ff
5 changed files with 40 additions and 1 deletions

View File

@@ -94,6 +94,8 @@ func Run(s *options.SchedulerServer) error {
stop := make(chan struct{})
defer close(stop)
informerFactory.Start(stop)
// Waiting for all cache to sync before scheduling.
informerFactory.WaitForCacheSync(stop)
run := func(_ <-chan struct{}) {
sched.Run()