Fix race in setting ctrlr for network
Race is with network.getController() method. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
06ff0a98a0
commit
3569adad28
|
@ -129,7 +129,9 @@ func (c *controller) getNetworksFromStore() ([]*network, error) {
|
||||||
|
|
||||||
for _, kvo := range kvol {
|
for _, kvo := range kvol {
|
||||||
n := kvo.(*network)
|
n := kvo.(*network)
|
||||||
|
n.Lock()
|
||||||
n.ctrlr = c
|
n.ctrlr = c
|
||||||
|
n.Unlock()
|
||||||
|
|
||||||
ec := &endpointCnt{n: n}
|
ec := &endpointCnt{n: n}
|
||||||
err = store.GetObject(datastore.Key(ec.Key()...), ec)
|
err = store.GetObject(datastore.Key(ec.Key()...), ec)
|
||||||
|
|
Loading…
Reference in New Issue