mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #12183 from runcom/remove-job-diff
Remove engine.Job from diff
This commit is contained in:
commit
94ade35e46
3 changed files with 17 additions and 35 deletions
|
@ -351,10 +351,24 @@ func getContainersChanges(eng *engine.Engine, version version.Version, w http.Re
|
|||
if vars == nil {
|
||||
return fmt.Errorf("Missing parameter")
|
||||
}
|
||||
var job = eng.Job("container_changes", vars["name"])
|
||||
streamJSON(job, w, false)
|
||||
|
||||
return job.Run()
|
||||
name := vars["name"]
|
||||
if name == "" {
|
||||
return fmt.Errorf("Container name cannot be empty")
|
||||
}
|
||||
|
||||
d := getDaemon(eng)
|
||||
cont, err := d.Get(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
changes, err := cont.Changes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return writeJSON(w, http.StatusOK, changes)
|
||||
}
|
||||
|
||||
func getContainersTop(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package daemon
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/engine"
|
||||
)
|
||||
|
||||
func (daemon *Daemon) ContainerChanges(job *engine.Job) error {
|
||||
if n := len(job.Args); n != 1 {
|
||||
return fmt.Errorf("Usage: %s CONTAINER", job.Name)
|
||||
}
|
||||
name := job.Args[0]
|
||||
|
||||
container, err := daemon.Get(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
changes, err := container.Changes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = json.NewEncoder(job.Stdout).Encode(changes); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -116,7 +116,6 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
|
|||
// FIXME: remove ImageDelete's dependency on Daemon, then move to graph/
|
||||
for name, method := range map[string]engine.Handler{
|
||||
"commit": daemon.ContainerCommit,
|
||||
"container_changes": daemon.ContainerChanges,
|
||||
"container_copy": daemon.ContainerCopy,
|
||||
"container_rename": daemon.ContainerRename,
|
||||
"container_inspect": daemon.ContainerInspect,
|
||||
|
|
Loading…
Reference in a new issue