Merge pull request #7384 from kofj/fix_deadlock

fix deadlock when client not exist.
This commit is contained in:
Wenkai Yin 2019-04-15 18:40:10 +08:00 committed by GitHub
commit 24e7019b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,9 @@ func NewDefaultImageRegistry(registry *model.Registry) (*DefaultImageRegistry, e
}
func (d *DefaultImageRegistry) getClient(repository string) (*registry_pkg.Repository, error) {
d.RLock()
client, exist := d.clients[repository]
d.RUnlock()
if exist {
return client, nil
}