mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Edits after code review
Return long image ID Return streamformatted error or "raw" error
This commit is contained in:
parent
bf8e0277bb
commit
8cc19765b4
2 changed files with 6 additions and 2 deletions
6
api.go
6
api.go
|
@ -481,7 +481,11 @@ func postImagesInsert(srv *Server, version float64, w http.ResponseWriter, r *ht
|
|||
sf := utils.NewStreamFormatter(version > 1.0)
|
||||
err := srv.ImageInsert(name, url, path, w, sf)
|
||||
if err != nil {
|
||||
w.Write(sf.FormatError(err))
|
||||
if sf.Used() {
|
||||
w.Write(sf.FormatError(err))
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -229,7 +229,7 @@ func (srv *Server) ImageInsert(name, url, path string, out io.Writer, sf *utils.
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out.Write(sf.FormatStatus(utils.TruncateID(img.ID), "Image created"))
|
||||
out.Write(sf.FormatStatus(img.ID, "Image created"))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue