mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
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:
commit
d9d1364657
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user