mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #32881 from coolljt0725/fix_exec_faild
Enable inspect exec if container is pause/restarting/non-running
This commit is contained in:
commit
53a75ee050
1 changed files with 7 additions and 3 deletions
|
@ -197,9 +197,13 @@ func (daemon *Daemon) getInspectData(container *container.Container) (*types.Con
|
||||||
// ContainerExecInspect returns low-level information about the exec
|
// ContainerExecInspect returns low-level information about the exec
|
||||||
// command. An error is returned if the exec cannot be found.
|
// command. An error is returned if the exec cannot be found.
|
||||||
func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, error) {
|
func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, error) {
|
||||||
e, err := daemon.getExecConfig(id)
|
e := daemon.execCommands.Get(id)
|
||||||
if err != nil {
|
if e == nil {
|
||||||
return nil, err
|
return nil, errExecNotFound(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
if container := daemon.containers.Get(e.ContainerID); container == nil {
|
||||||
|
return nil, errExecNotFound(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
pc := inspectExecProcessConfig(e)
|
pc := inspectExecProcessConfig(e)
|
||||||
|
|
Loading…
Reference in a new issue