Add ctr attach for reattaching to running task

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-08 10:16:40 -07:00
parent a6314cad65
commit 5d1669bcfb
5 changed files with 87 additions and 4 deletions

View File

@@ -193,11 +193,16 @@ func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, erro
return nil, err
}
}
// create and close a channel on load as we already have the pid
// and don't want to block calls to Wait(), etc...
ps := make(chan struct{})
close(ps)
t := &task{
client: c.client,
io: i,
containerID: response.Task.ContainerID,
pid: response.Task.Pid,
pidSync: ps,
}
c.task = t
return t, nil