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:
Alexander Morozov 2016-01-08 13:31:17 -08:00
parent 06ff0a98a0
commit 3569adad28
1 changed files with 2 additions and 0 deletions

View File

@ -129,7 +129,9 @@ func (c *controller) getNetworksFromStore() ([]*network, error) {
for _, kvo := range kvol {
n := kvo.(*network)
n.Lock()
n.ctrlr = c
n.Unlock()
ec := &endpointCnt{n: n}
err = store.GetObject(datastore.Key(ec.Key()...), ec)