ctr: error if tty && nullIO
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
parent
04659d9405
commit
e0da28acc4
@ -12,6 +12,7 @@ import (
|
||||
"github.com/containerd/console"
|
||||
"github.com/containerd/containerd"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
@ -121,6 +122,9 @@ func newTask(ctx gocontext.Context, client *containerd.Client, container contain
|
||||
io = containerd.StdioTerminal
|
||||
}
|
||||
if nullIO {
|
||||
if tty {
|
||||
return nil, errors.New("tty and null-io cannot be used together")
|
||||
}
|
||||
io = containerd.NullIO
|
||||
}
|
||||
return container.NewTask(ctx, io)
|
||||
|
@ -123,6 +123,9 @@ func newTask(ctx gocontext.Context, client *containerd.Client, container contain
|
||||
io = containerd.StdioTerminal
|
||||
}
|
||||
if nullIO {
|
||||
if tty {
|
||||
return nil, errors.New("tty and null-io cannot be used together")
|
||||
}
|
||||
io = containerd.NullIO
|
||||
}
|
||||
return container.NewTask(ctx, io)
|
||||
|
Loading…
Reference in New Issue
Block a user