1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-04 16:50:41 +00:00

Fix bug in which all handlers would be trigger on incremental add

This commit is contained in:
Darren Shepherd
2018-11-09 10:20:45 -07:00
parent 650be9239e
commit a21f7b7e4c

View File

@@ -187,11 +187,9 @@ func (g *genericController) Start(ctx context.Context, threadiness int) error {
g.Lock() g.Lock()
defer g.Unlock() defer g.Unlock()
if !g.synced {
if err := g.sync(ctx); err != nil { if err := g.sync(ctx); err != nil {
return err return err
} }
}
if !g.running { if !g.running {
if g.threadinessOverride > 0 { if g.threadinessOverride > 0 {
@@ -202,7 +200,7 @@ func (g *genericController) Start(ctx context.Context, threadiness int) error {
if g.running { if g.running {
for _, h := range g.handlers { for _, h := range g.handlers {
if h.generation != g.generation { if h.generation < g.generation {
continue continue
} }
for _, key := range g.informer.GetStore().ListKeys() { for _, key := range g.informer.GetStore().ListKeys() {