Do not start a ContainerExec twice

ContainerExecStart and ContainerExecAttach both call the /exec/id/start API
endpoint.

PiperOrigin-RevId: 344946627
This commit is contained in:
Zeling Feng
2020-11-30 21:22:55 -08:00
committed by gVisor bot
parent 79e2364933
commit 59a2c785bf
-5
View File
@@ -77,11 +77,6 @@ func (c *Container) doExec(ctx context.Context, r ExecOpts, args []string) (Proc
return Process{}, fmt.Errorf("exec attach failed with err: %v", err)
}
if err := c.client.ContainerExecStart(ctx, resp.ID, types.ExecStartCheck{}); err != nil {
hijack.Close()
return Process{}, fmt.Errorf("exec start failed with err: %v", err)
}
return Process{
container: c,
execid: resp.ID,