This commit is contained in:
Victor Vieux 2013-05-08 23:19:24 +02:00
Родитель bf605fcfc7
Коммит 1d42cbaa21
1 изменённых файлов: 0 добавлений и 7 удалений

7
api.go
Просмотреть файл

@ -111,7 +111,6 @@ func getContainersExport(srv *Server, w http.ResponseWriter, r *http.Request) ([
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ContainerExport(name, out); err != nil { if err := srv.ContainerExport(name, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err) fmt.Fprintf(out, "Error: %s\n", err)
return nil, err
} }
return nil, nil return nil, nil
} }
@ -270,12 +269,10 @@ func postImages(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, er
registry := r.Form.Get("registry") registry := r.Form.Get("registry")
if err := srv.ImagePull(image, tag, registry, out); err != nil { if err := srv.ImagePull(image, tag, registry, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err) fmt.Fprintf(out, "Error: %s\n", err)
return nil, err
} }
} else { //import } else { //import
if err := srv.ImageImport(src, repo, tag, in, out); err != nil { if err := srv.ImageImport(src, repo, tag, in, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err) fmt.Fprintf(out, "Error: %s\n", err)
return nil, err
} }
} }
return nil, nil return nil, nil
@ -316,7 +313,6 @@ func postImagesInsert(srv *Server, w http.ResponseWriter, r *http.Request) ([]by
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ImageInsert(name, url, path, out); err != nil { if err := srv.ImageInsert(name, url, path, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err) fmt.Fprintf(out, "Error: %s\n", err)
return nil, err
} }
return nil, nil return nil, nil
} }
@ -339,7 +335,6 @@ func postImagesPush(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ImagePush(name, registry, out); err != nil { if err := srv.ImagePush(name, registry, out); err != nil {
fmt.Fprintln(out, "Error: %s\n", err) fmt.Fprintln(out, "Error: %s\n", err)
return nil, err
} }
return nil, nil return nil, nil
} }
@ -353,7 +348,6 @@ func postBuild(srv *Server, w http.ResponseWriter, r *http.Request) ([]byte, err
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ImageCreateFromFile(in, out); err != nil { if err := srv.ImageCreateFromFile(in, out); err != nil {
fmt.Fprintln(out, "Error: %s\n", err) fmt.Fprintln(out, "Error: %s\n", err)
return nil, err
} }
return nil, nil return nil, nil
} }
@ -487,7 +481,6 @@ func postContainersAttach(srv *Server, w http.ResponseWriter, r *http.Request) (
fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n") fmt.Fprintf(out, "HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
if err := srv.ContainerAttach(name, logs, stream, stdin, stdout, stderr, in, out); err != nil { if err := srv.ContainerAttach(name, logs, stream, stdin, stdout, stderr, in, out); err != nil {
fmt.Fprintf(out, "Error: %s\n", err) fmt.Fprintf(out, "Error: %s\n", err)
return nil, err
} }
return nil, nil return nil, nil
} }