fix controller Start method signature

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 09:05:53 +00:00
parent 810bfb618a
commit 2fcfb81066
39 changed files with 106 additions and 120 deletions

View File

@@ -332,9 +332,9 @@ func (c *IPPoolController) processIPPool(name string) (*time.Duration, error) {
return nil, c.updateIPPoolStatus(pool)
}
func (c *IPPoolController) Start(stopCh <-chan struct{}) error {
go c.provider.SyncStatus(stopCh, c.ippoolQueue)
return c.Run(5, stopCh)
func (c *IPPoolController) Start(ctx context.Context) error {
go c.provider.SyncStatus(ctx.Done(), c.ippoolQueue)
return c.Run(5, ctx.Done())
}
func (c *IPPoolController) Run(workers int, stopCh <-chan struct{}) error {

View File

@@ -77,7 +77,7 @@ var _ = Describe("test ippool", func() {
stopCh := make(chan struct{})
go ksInformer.Start(stopCh)
go k8sInformer.Start(stopCh)
go c.Start(stopCh)
go c.Start(context.Background())
It("test create ippool", func() {
clone := pool.DeepCopy()