mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix some races in getNetworkFromStore
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
16efd61364
commit
74cf622463
2 changed files with 3 additions and 1 deletions
|
@ -343,7 +343,7 @@ func (ep *endpoint) getNetworkFromStore() (*network, error) {
|
|||
return nil, fmt.Errorf("invalid network object in endpoint %s", ep.Name())
|
||||
}
|
||||
|
||||
return ep.network.ctrlr.getNetworkFromStore(ep.network.id)
|
||||
return ep.network.getController().getNetworkFromStore(ep.network.id)
|
||||
}
|
||||
|
||||
func (ep *endpoint) Join(sbox Sandbox, options ...EndpointOption) error {
|
||||
|
|
|
@ -141,8 +141,10 @@ func (c *controller) getNetworksFromStore() ([]*network, error) {
|
|||
return nil, fmt.Errorf("could not find endpoint count key %s for network %s while listing: %v", datastore.Key(ec.Key()...), n.Name(), err)
|
||||
}
|
||||
|
||||
n.Lock()
|
||||
n.epCnt = ec
|
||||
n.scope = store.Scope()
|
||||
n.Unlock()
|
||||
nl = append(nl, n)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue