Merge pull request #12305 from runcom/remove-job-exec-inspect
Remove job from execInspect
This commit is contained in:
commit
a54fd325e6
3 changed files with 11 additions and 16 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue