Merge pull request #2303 from xianlubird/bug/concurrent_network

Fix network Uniq method concurrent map writes problem
This commit is contained in:
Xian Chaobo 2016-06-20 19:03:58 +08:00 committed by GitHub
commit a34785e489
1 changed files with 6 additions and 1 deletions

View File

@ -30,7 +30,12 @@ func (networks Networks) Uniq() Networks {
tmp[network.ID].Containers[id] = endpoint
}
} else {
tmp[network.ID] = network
netCopy := *network
netCopy.Containers = make(map[string]types.EndpointResource)
for key, value := range network.Containers {
netCopy.Containers[key] = value
}
tmp[network.ID] = &netCopy
}
}
uniq := Networks{}