Browse code

Merge pull request #32881 from coolljt0725/fix_exec_faild

Enable inspect exec if container is pause/restarting/non-running

Sebastiaan van Stijn authored on 2017/07/13 11:29:27
Showing 1 changed files
... ...
@@ -197,9 +197,13 @@ func (daemon *Daemon) getInspectData(container *container.Container) (*types.Con
197 197
 // ContainerExecInspect returns low-level information about the exec
198 198
 // command. An error is returned if the exec cannot be found.
199 199
 func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, error) {
200
-	e, err := daemon.getExecConfig(id)
201
-	if err != nil {
202
-		return nil, err
200
+	e := daemon.execCommands.Get(id)
201
+	if e == nil {
202
+		return nil, errExecNotFound(id)
203
+	}
204
+
205
+	if container := daemon.containers.Get(e.ContainerID); container == nil {
206
+		return nil, errExecNotFound(id)
203 207
 	}
204 208
 
205 209
 	pc := inspectExecProcessConfig(e)