mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 05:31:47 +00:00
Handle the case where poolAdd() gives an error for an unknown pool type
This commit is contained in:
@@ -988,11 +988,15 @@ func (srv *Server) ImagePull(localName string, tag string, out io.Writer, sf *ut
|
||||
|
||||
out = utils.NewWriteFlusher(out)
|
||||
|
||||
if c, err := srv.poolAdd("pull", localName+":"+tag); err != nil {
|
||||
// Another pull of the same repository is already taking place; just wait for it to finish
|
||||
out.Write(sf.FormatStatus("", "Repository %s already being pulled by another client. Waiting.", localName))
|
||||
<-c
|
||||
return nil
|
||||
c, err := srv.poolAdd("pull", localName+":"+tag)
|
||||
if err != nil {
|
||||
if c != nil {
|
||||
// Another pull of the same repository is already taking place; just wait for it to finish
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user