1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #12305 from runcom/remove-job-exec-inspect

Remove job from execInspect
This commit is contained in:
Doug Davis 2015-04-12 08:30:38 -04:00
commit a54fd325e6
3 changed files with 11 additions and 16 deletions

View file

@ -1157,9 +1157,14 @@ func getExecByID(eng *engine.Engine, version version.Version, w http.ResponseWri
if vars == nil {
return fmt.Errorf("Missing parameter 'id'")
}
var job = eng.Job("execInspect", vars["id"])
streamJSON(job, w, false)
return job.Run()
d := getDaemon(eng)
eConfig, err := d.ContainerExecInspect(vars["id"])
if err != nil {
return err
}
return writeJSON(w, http.StatusOK, eConfig)
}
func getImagesByName(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

View file

@ -128,7 +128,6 @@ func (daemon *Daemon) Install(eng *engine.Engine) error {
"start": daemon.ContainerStart,
"execCreate": daemon.ContainerExecCreate,
"execStart": daemon.ContainerExecStart,
"execInspect": daemon.ContainerExecInspect,
} {
if err := eng.Register(name, method); err != nil {
return err

View file

@ -80,20 +80,11 @@ func (daemon *Daemon) ContainerInspect(job *engine.Job) error {
return nil
}
func (daemon *Daemon) ContainerExecInspect(job *engine.Job) error {
if len(job.Args) != 1 {
return fmt.Errorf("usage: %s ID", job.Name)
}
id := job.Args[0]
func (daemon *Daemon) ContainerExecInspect(id string) (*execConfig, error) {
eConfig, err := daemon.getExecConfig(id)
if err != nil {
return err
return nil, err
}
b, err := json.Marshal(*eConfig)
if err != nil {
return err
}
job.Stdout.Write(b)
return nil
return eConfig, nil
}