mirror of https://github.com/docker/docs.git
Merge pull request #2303 from xianlubird/bug/concurrent_network
Fix network Uniq method concurrent map writes problem
This commit is contained in:
commit
a34785e489
|
@ -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{}
|
||||
|
|
Loading…
Reference in New Issue