Explorar el Código

Merge pull request #1103 from shin-/1060-pull-only-tagged-images

*Registry: When no tag is specified in docker pull, skip images that are not tagged
Victor Vieux hace 12 años
padre
commit
1c5083315d
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      server.go

+ 6 - 1
server.go

@@ -402,7 +402,7 @@ func (srv *Server) pullRepository(r *registry.Registry, out io.Writer, local, re
 		// Otherwise, check that the tag exists and use only that one
 		id, exists := tagsList[askedTag]
 		if !exists {
-			return fmt.Errorf("Tag %s not found in repositoy %s", askedTag, local)
+			return fmt.Errorf("Tag %s not found in repository %s", askedTag, local)
 		}
 		repoData.ImgList[id].Tag = askedTag
 	}
@@ -412,6 +412,11 @@ func (srv *Server) pullRepository(r *registry.Registry, out io.Writer, local, re
 			utils.Debugf("(%s) does not match %s (id: %s), skipping", img.Tag, askedTag, img.ID)
 			continue
 		}
+
+		if img.Tag == "" {
+			utils.Debugf("Image (id: %s) present in this repository but untagged, skipping", img.ID)
+			continue
+		}
 		out.Write(sf.FormatStatus("Pulling image %s (%s) from %s", img.ID, img.Tag, remote))
 		success := false
 		for _, ep := range repoData.Endpoints {