aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-13 14:26:35 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-14 13:48:35 +0000
commit62b59df053357f040d85c26727734815046e2bc3 (patch)
treedadaca27a628d9612c3a84f3d0e95a22a08a366c
parent9aafc25a3d5c34b89ccd1e9866fbe57b171cf001 (diff)
downloadpodman-62b59df053357f040d85c26727734815046e2bc3.tar.gz
podman-62b59df053357f040d85c26727734815046e2bc3.tar.bz2
podman-62b59df053357f040d85c26727734815046e2bc3.zip
Allow the use of -i/-a on any container
We used to not allow the use of -a/-i on containers that were not started with -i or a tty. Given the improvements in our terminal handling, this should work now. This also fixes a systemic problem with the autotests. Signed-off-by: baude <bbaude@redhat.com> Closes: #617 Approved by: baude
-rw-r--r--cmd/podman/start.go16
-rw-r--r--test/e2e/run_restart_test.go2
2 files changed, 2 insertions, 16 deletions
diff --git a/cmd/podman/start.go b/cmd/podman/start.go
index 597ed29ae..00d153904 100644
--- a/cmd/podman/start.go
+++ b/cmd/podman/start.go
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
- "strconv"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
@@ -91,20 +90,7 @@ func startCmd(c *cli.Context) error {
continue
}
- // We can only be interactive if both the config and the command-line say so
- if c.Bool("interactive") && !ctr.Config().Stdin {
- return errors.Errorf("the container was not created with the interactive option")
- }
-
- tty, err := strconv.ParseBool(ctr.Spec().Annotations["io.kubernetes.cri-o.TTY"])
- if err != nil {
- return errors.Wrapf(err, "unable to parse annotations in %s", ctr.ID())
- }
-
- // Handle start --attach
- // We only get a terminal session if both a tty was specified in the spec and
- // -a on the command-line was given.
- if attach && tty {
+ if attach {
inputStream := os.Stdin
if !c.Bool("interactive") {
inputStream = nil
diff --git a/test/e2e/run_restart_test.go b/test/e2e/run_restart_test.go
index 72a48987d..84eb69b0c 100644
--- a/test/e2e/run_restart_test.go
+++ b/test/e2e/run_restart_test.go
@@ -46,7 +46,7 @@ var _ = Describe("Podman run restart containers", func() {
killSession.WaitWithDefaultTimeout()
Expect(killSession.ExitCode()).To(Equal(0))
- session2 := podmanTest.Podman([]string{"start", "--attach", "test1"})
+ session2 := podmanTest.Podman([]string{"start", "test1"})
session2.WaitWithDefaultTimeout()
Expect(session2.ExitCode()).To(Equal(0))
})