mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Handle the case where poolAdd() gives an error for an unknown pool type
This commit is contained in:
parent
ae474e05f5
commit
788feab3a7
1 changed files with 9 additions and 5 deletions
14
server.go
14
server.go
|
@ -988,11 +988,15 @@ func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *ut
|
||||||
|
|
||||||
out = utils.NewWriteFlusher(out)
|
out = utils.NewWriteFlusher(out)
|
||||||
|
|
||||||
if c, err := srv.poolAdd("pull", localName+":"+tag); err != nil {
|
c, err := srv.poolAdd("pull", localName+":"+tag)
|
||||||
// Another pull of the same repository is already taking place; just wait for it to finish
|
if err != nil {
|
||||||
out.Write(sf.FormatStatus("", "Repository %s already being pulled by another client. Waiting.", localName))
|
if c != nil {
|
||||||
<-c
|
// Another pull of the same repository is already taking place; just wait for it to finish
|
||||||
return nil
|
out.Write(sf.FormatStatus("", "Repository %s already being pulled by another client. Waiting.", localName))
|
||||||
|
<-c
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
defer srv.poolRemove("pull", localName+":"+tag)
|
defer srv.poolRemove("pull", localName+":"+tag)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue