imagerefchecker: fix concurrent map access
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>docker-18.09
parent
8f4dff0d16
commit
e210ffc72e
|
@ -90,9 +90,13 @@ func (c *checker) init() {
|
|||
return
|
||||
}
|
||||
|
||||
var mu sync.Mutex
|
||||
|
||||
for _, img := range imgs {
|
||||
if err := images.Dispatch(context.TODO(), images.Handlers(layersHandler(c.opt.ContentStore, func(layers []specs.Descriptor) {
|
||||
mu.Lock()
|
||||
c.registerLayers(layers)
|
||||
mu.Unlock()
|
||||
})), img.Target); err != nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue