mirror of https://github.com/docker/docs.git
Fix network uniq method concurrent map writes problem
Signed-off-by: Xianlu <xianlu.cxl@alibaba-inc.com>
This commit is contained in:
parent
ff40997d68
commit
c4886bd006
|
@ -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