Reduce the number of IO constructors

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2017-12-07 14:09:08 -05:00
parent a901091f7c
commit 7d4337e738
9 changed files with 171 additions and 139 deletions

View File

@@ -42,9 +42,9 @@ func HandleConsoleResize(ctx gocontext.Context, task resizer, con console.Consol
// NewTask creates a new task
func NewTask(ctx gocontext.Context, client *containerd.Client, container containerd.Container, _ string, tty, nullIO bool) (containerd.Task, error) {
ioCreator := cio.Stdio
ioCreator := cio.NewCreator(cio.WithStdio)
if tty {
ioCreator = cio.StdioTerminal
ioCreator = cio.NewCreator(cio.WithStdio, cio.WithTerminal)
}
if nullIO {
if tty {