浏览代码

Remove the lookup before pushing

Guillaume J. Charmes 12 年之前
父节点
当前提交
89763bc8af
共有 2 个文件被更改,包括 9 次插入4 次删除
  1. 5 1
      commands.go
  2. 4 3
      registry.go

+ 5 - 1
commands.go

@@ -425,15 +425,19 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string
 		remote = local
 		remote = local
 	}
 	}
 
 
+	Debugf("Pushing [%s] to [%s]\n", local, remote)
+
 	// Try to get the image
 	// Try to get the image
 	// FIXME: Handle lookup
 	// FIXME: Handle lookup
 	// FIXME: Also push the tags in case of ./docker push myrepo:mytag
 	// FIXME: Also push the tags in case of ./docker push myrepo:mytag
 	//	img, err := srv.runtime.LookupImage(cmd.Arg(0))
 	//	img, err := srv.runtime.LookupImage(cmd.Arg(0))
 	img, err := srv.runtime.graph.Get(local)
 	img, err := srv.runtime.graph.Get(local)
 	if err != nil {
 	if err != nil {
+		Debugf("The push refers to a repository [%s] (len: %d)\n", local, len(srv.runtime.repositories.Repositories[local]))
+
 		// If it fails, try to get the repository
 		// If it fails, try to get the repository
 		if localRepo, exists := srv.runtime.repositories.Repositories[local]; exists {
 		if localRepo, exists := srv.runtime.repositories.Repositories[local]; exists {
-			fmt.Fprintf(stdout, "Pushing %s (%d images) on %s...\n", local, len(localRepo), remote)
+			fmt.Fprintf(stdout, "Pushing %s (%d tags) on %s...\n", local, len(localRepo), remote)
 			if err := srv.runtime.graph.PushRepository(remote, localRepo, srv.runtime.authConfig); err != nil {
 			if err := srv.runtime.graph.PushRepository(remote, localRepo, srv.runtime.authConfig); err != nil {
 				return err
 				return err
 			}
 			}

+ 4 - 3
registry.go

@@ -370,9 +370,10 @@ func (graph *Graph) pushPrimitive(remote, tag, imgId string, authConfig *auth.Au
 // Remote has the format '<user>/<repo>
 // Remote has the format '<user>/<repo>
 func (graph *Graph) PushRepository(remote string, localRepo Repository, authConfig *auth.AuthConfig) error {
 func (graph *Graph) PushRepository(remote string, localRepo Repository, authConfig *auth.AuthConfig) error {
 	// Check if the remote repository exists
 	// Check if the remote repository exists
-	if !graph.LookupRemoteRepository(remote, authConfig) {
-		return fmt.Errorf("The remote repository %s does not exist\n", remote)
-	}
+	// FIXME: @lopter How to handle this?
+	// if !graph.LookupRemoteRepository(remote, authConfig) {
+	// 	return fmt.Errorf("The remote repository %s does not exist\n", remote)
+	// }
 
 
 	// For each image within the repo, push them
 	// For each image within the repo, push them
 	for tag, imgId := range localRepo {
 	for tag, imgId := range localRepo {