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:
Paul Holzinger
2026-05-29 13:19:14 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -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")
}

View File

@@ -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()