Merge pull request #651 from tonistiigi/concurrent-map-fix

imagerefchecker: fix concurrent map access
docker-18.09
Tibor Vass 2018-09-27 17:41:27 -07:00 committed by GitHub
commit e9e9503848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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
}