浏览代码

Skip missing images instead of failing the push

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

+ 3 - 2
registry.go

@@ -357,10 +357,11 @@ func (graph *Graph) LookupRemoteRepository(remote string, authConfig *auth.AuthC
 }
 
 func (graph *Graph) pushPrimitive(stdout io.Writer, remote, tag, imgId string, authConfig *auth.AuthConfig) error {
-	// CHeck if the local impage exists
+	// Check if the local impage exists
 	img, err := graph.Get(imgId)
 	if err != nil {
-		return err
+		fmt.Fprintf(stdout, "Image %s for tag %s not found, skipping.\n", imgId, tag)
+		return nil
 	}
 	// Push the image
 	if err = graph.PushImage(stdout, img, authConfig); err != nil {