Add CloseStdin to task

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-05-31 15:53:42 -07:00
parent 6aeeefe2b2
commit 9890bed1e1
3 changed files with 120 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ type Task interface {
Wait(context.Context) (uint32, error)
Exec(context.Context, *specs.Process, IOCreation) (Process, error)
Processes(context.Context) ([]uint32, error)
CloseStdin(context.Context) error
}
type Process interface {
@@ -158,3 +159,11 @@ func (t *task) Processes(ctx context.Context) ([]uint32, error) {
}
return out, nil
}
func (t *task) CloseStdin(ctx context.Context) error {
_, err := t.client.TaskService().CloseStdin(ctx, &execution.CloseStdinRequest{
ContainerID: t.containerID,
Pid: t.pid,
})
return err
}