mirror of
https://github.com/containers/podman.git
synced 2026-07-20 20:22:02 -04:00
Merge pull request #28806 from martinetd/detach_run_tty
cmd/podman: don't warn on `podman run -ti -d` from not a tty
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user