diff options
-rw-r--r-- | cmd/podman/create.go | 6 | ||||
-rw-r--r-- | libpod/container_attach.go | 16 | ||||
-rw-r--r-- | test/e2e/run_privileged_test.go | 2 |
3 files changed, 3 insertions, 21 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go index fe6d30c9e..a25f31717 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -447,13 +447,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string, return nil, err } - // Because we cannot do a non-terminal attach, we need to set tty to true - // if detach is not false - // TODO Allow non-terminal attach tty := c.Bool("tty") - if !c.Bool("detach") && !tty { - tty = true - } pidMode := container.PidMode(c.String("pid")) if !pidMode.Valid() { diff --git a/libpod/container_attach.go b/libpod/container_attach.go index 3b8f29edb..40d359ddd 100644 --- a/libpod/container_attach.go +++ b/libpod/container_attach.go @@ -83,18 +83,6 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi outputStream := os.Stdout errorStream := os.Stderr defer inputStream.Close() - - // TODO Renable this when tty/terminal discussion is had. - /* - tty, err := strconv.ParseBool(c.runningSpec.Annotations["io.kubernetes.cri-o.TTY"]) - if err != nil { - return errors.Wrapf(err, "unable to parse annotations in %s", c.ID) - } - if !tty { - return errors.Errorf("no tty available for %s", c.ID()) - } - */ - if terminal.IsTerminal(int(inputStream.Fd())) { oldTermState, err := term.SaveState(inputStream.Fd()) if err != nil { @@ -104,8 +92,8 @@ func (c *Container) attachContainerSocket(resize <-chan remotecommand.TerminalSi defer term.RestoreTerminal(inputStream.Fd(), oldTermState) } - // Put both input and output into raw - if !noStdIn { + // Put both input and output into raw when we have a terminal + if !noStdIn && c.config.Spec.Process.Terminal { term.SetRawTerminal(inputStream.Fd()) } diff --git a/test/e2e/run_privileged_test.go b/test/e2e/run_privileged_test.go index 6692c91c7..426b83d3c 100644 --- a/test/e2e/run_privileged_test.go +++ b/test/e2e/run_privileged_test.go @@ -69,7 +69,7 @@ var _ = Describe("Podman privileged container tests", func() { }) It("podman non-privileged should have very few devices", func() { - session := podmanTest.Podman([]string{"run", "busybox", "ls", "-l", "/dev"}) + session := podmanTest.Podman([]string{"run", "-t", "busybox", "ls", "-l", "/dev"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) Expect(len(session.OutputToStringArray())).To(Equal(18)) |