Skip to content

Commit

Permalink
fix: wait subnet ready before start worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Aug 2, 2019
1 parent 194ca60 commit 5f1436b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,11 @@ func (c *Controller) Run(stopCh <-chan struct{}) error {
klog.Info("Starting workers")

// Launch workers to process resources
go wait.Until(c.runAddIpPoolPodWorker, time.Second, stopCh)
go wait.Until(c.runAddSubnetWorker, time.Second, stopCh)
// wait default/join subnet ready
time.Sleep(3 * time.Second)

go wait.Until(c.runAddIpPoolPodWorker, time.Second, stopCh)
for i := 0; i < c.config.WorkerNum; i++ {
go wait.Until(c.runAddPodWorker, time.Second, stopCh)
go wait.Until(c.runDeletePodWorker, time.Second, stopCh)
Expand Down

0 comments on commit 5f1436b

Please sign in to comment.