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.
```
This commit is contained in:
Kubernetes Submit Queue 2018-03-21 08:25:44 -07:00 committed by GitHub
commit d9d1364657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,14 +174,15 @@ func (c *Controller) onAdd(node *v1.Node) error {
c.lock.Lock()
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)
c.syncers[node.Name] = syncer
go syncer.Loop(nil)
} else {
glog.Warningf("Add for node %q that already exists", node.Name)
syncer.Update(node)
}
syncer.Update(node)
return nil
}