diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index 3e58c6e628..a6d5b89f05 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -116,8 +116,8 @@ func run(cmd *cobra.Command, args []string) error { } cliVals.Rm = true } - // TODO: Breaking change should be made fatal in next major Release - if cliVals.TTY && cliVals.Interactive && !term.IsTerminal(int(os.Stdin.Fd())) { + + if cliVals.TTY && cliVals.Interactive && !runOpts.Detach && !term.IsTerminal(int(os.Stdin.Fd())) { logrus.Warnf("The input device is not a TTY. The --tty and --interactive flags might not work properly") } diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index 7f72c8c78a..4009445d1e 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -342,11 +342,12 @@ var _ = Describe("Podman exec", func() { // #10927 ("no logs from conmon"), one of our nastiest flakes It("podman exec terminal doesn't hang", FlakeAttempts(3), func() { - setup := podmanTest.Podman([]string{"run", "-dti", "--name", "test1", FEDORA_MINIMAL, "sleep", "+Inf"}) + setup := podmanTest.Podman([]string{"run", "-ti", "--rm", "--name", "test1", FEDORA_MINIMAL, "true"}) setup.WaitWithDefaultTimeout() Expect(setup).Should(Exit(0)) Expect(setup.ErrorToString()).To(ContainSubstring("The input device is not a TTY. The --tty and --interactive flags might not work properly")) + podmanTest.PodmanExitCleanly("run", "-dti", "--name", "test1", FEDORA_MINIMAL, "sleep", "+Inf") for range 5 { session := podmanTest.Podman([]string{"exec", "-ti", "test1", "true"}) session.WaitWithDefaultTimeout()