From 3cac43ed01b641de7b7b1f40d2a7b1720d290ff2 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Tue, 7 Nov 2017 06:12:05 +0000 Subject: [PATCH] Fix attach and exec. Signed-off-by: Lantao Liu --- cmd/crictl/attach.go | 2 ++ cmd/crictl/exec.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/crictl/attach.go b/cmd/crictl/attach.go index 653515b799..debd8bb08d 100644 --- a/cmd/crictl/attach.go +++ b/cmd/crictl/attach.go @@ -80,6 +80,8 @@ func Attach(client pb.RuntimeServiceClient, opts attachOptions) error { ContainerId: opts.id, Tty: opts.tty, Stdin: opts.stdin, + Stdout: true, + Stderr: !opts.tty, } logrus.Debugf("AttachRequest: %v", request) r, err := client.Attach(context.Background(), request) diff --git a/cmd/crictl/exec.go b/cmd/crictl/exec.go index b5ba884f09..1032c9b30d 100644 --- a/cmd/crictl/exec.go +++ b/cmd/crictl/exec.go @@ -71,7 +71,7 @@ var runtimeExecCommand = cli.Command{ id: context.Args().First(), timeout: context.Int64("timeout"), tty: context.Bool("tty"), - stdin: context.Bool("stdin"), + stdin: context.Bool("interactive"), cmd: context.Args()[1:], } if context.Bool("sync") { @@ -120,6 +120,8 @@ func Exec(client pb.RuntimeServiceClient, opts execOptions) error { Cmd: opts.cmd, Tty: opts.tty, Stdin: opts.stdin, + Stdout: true, + Stderr: !opts.tty, } logrus.Debugf("ExecRequest: %v", request) r, err := client.Exec(context.Background(), request)