Use ContainerCommitResponse struct for Commit cmd

Signed-off-by: Jamie Hannaford <jamie.hannaford@rackspace.com>
This commit is contained in:
Jamie Hannaford
2015-03-28 17:55:45 +01:00
parent 61069d8b69
commit 8b795a05a8
3 changed files with 15 additions and 8 deletions
+3 -3
View File
@@ -507,7 +507,6 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit
}
var (
config engine.Env
env engine.Env
job = eng.Job("commit", r.Form.Get("container"))
stdoutBuffer = bytes.NewBuffer(nil)
)
@@ -537,8 +536,9 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit
if err := job.Run(); err != nil {
return err
}
env.Set("Id", engine.Tail(stdoutBuffer, 1))
return writeJSONEnv(w, http.StatusCreated, env)
return writeJSON(w, http.StatusCreated, &types.ContainerCommitResponse{
ID: engine.Tail(stdoutBuffer, 1),
})
}
// Creates an image from Pull or from Import