Merge pull request #1676 from AkihiroSuda/null-io-fix
ctr: error if tty && nullIO
This commit is contained in:
commit
b93bd0cfec
@ -13,6 +13,7 @@ import (
|
||||
"github.com/containerd/containerd"
|
||||
"github.com/containerd/containerd/cmd/ctr/commands"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
@ -122,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)
|
||||
|
@ -124,6 +124,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