From a21f7b7e4c99cb79c31a7ccb2796a0596e180728 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 9 Nov 2018 10:20:45 -0700 Subject: [PATCH] Fix bug in which all handlers would be trigger on incremental add --- controller/generic_controller.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/controller/generic_controller.go b/controller/generic_controller.go index ea06aa33..87453a36 100644 --- a/controller/generic_controller.go +++ b/controller/generic_controller.go @@ -187,10 +187,8 @@ func (g *genericController) Start(ctx context.Context, threadiness int) error { g.Lock() defer g.Unlock() - if !g.synced { - if err := g.sync(ctx); err != nil { - return err - } + if err := g.sync(ctx); err != nil { + return err } if !g.running { @@ -202,7 +200,7 @@ func (g *genericController) Start(ctx context.Context, threadiness int) error { if g.running { for _, h := range g.handlers { - if h.generation != g.generation { + if h.generation < g.generation { continue } for _, key := range g.informer.GetStore().ListKeys() {