Unverified Commit d9d13646 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #61124 from satyasm/avoid-sync-delay

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix Issue #61123, call syncer.Update on add event. **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #61123 **Special notes for your reviewer**: **Release note**: ```release-note Fixed #61123 by triggering syncer.Update on all cases including when a syncer is created on a new add event. ```
parents 808545a8 4b2de756
...@@ -174,14 +174,15 @@ func (c *Controller) onAdd(node *v1.Node) error { ...@@ -174,14 +174,15 @@ func (c *Controller) onAdd(node *v1.Node) error {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()
if syncer, ok := c.syncers[node.Name]; !ok { syncer, ok := c.syncers[node.Name]
if !ok {
syncer = c.newSyncer(node.Name) syncer = c.newSyncer(node.Name)
c.syncers[node.Name] = syncer c.syncers[node.Name] = syncer
go syncer.Loop(nil) go syncer.Loop(nil)
} else { } else {
glog.Warningf("Add for node %q that already exists", node.Name) glog.Warningf("Add for node %q that already exists", node.Name)
syncer.Update(node)
} }
syncer.Update(node)
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment