mirror of
https://github.com/docker/docs.git
synced 2026-03-27 22:38:54 +07:00
Fix network uniq method concurrent map writes problem
Signed-off-by: Xianlu <xianlu.cxl@alibaba-inc.com>
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user