From 4f2666bec072fd0d556ad5b280679386e4f24ed7 Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 25 Apr 2019 16:18:40 -0500 Subject: Fix remote-client testing reports Ensure when using remote attach --no-stdin a mock device is used to prevent stdin and not nil. This fixes issue #3009. When starting a container with the remote client, if the container is already running and the user asks to attach, we should just attach. This fixes issue #3011 Signed-off-by: baude --- pkg/adapter/containers_remote.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/adapter') diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go index e8f221eaf..985310cce 100644 --- a/pkg/adapter/containers_remote.go +++ b/pkg/adapter/containers_remote.go @@ -584,7 +584,10 @@ func (r *LocalRuntime) Attach(ctx context.Context, c *cliconfig.AttachValues) er } inputStream := os.Stdin if c.NoStdin { - inputStream = nil + inputStream, err = os.Open(os.DevNull) + if err != nil { + return err + } } errChan, err := r.attach(ctx, inputStream, os.Stdout, c.InputArgs[0], false, c.DetachKeys) if err != nil { -- cgit v1.2.3-54-g00ecf