summaryrefslogtreecommitdiff
path: root/cmd/kpod/create.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2017-11-08 15:14:33 -0600
committerbaude <bbaude@redhat.com>2017-11-15 16:27:57 -0600
commitacd9c668647d273488772bfcb06a0f1a44dfb411 (patch)
tree5ff634e00c700b16f1ae4369df4ea021a4888073 /cmd/kpod/create.go
parent5cfd7a313fcae7c748b5bae84de779b28d4ea01b (diff)
downloadpodman-acd9c668647d273488772bfcb06a0f1a44dfb411.tar.gz
podman-acd9c668647d273488772bfcb06a0f1a44dfb411.tar.bz2
podman-acd9c668647d273488772bfcb06a0f1a44dfb411.zip
Fix terminal attach
Re-order the startup of a new container via run from initialize > start > attach to initialize > attach > start. This fixes output when running: kpod run -i -t IMAGE command and kpod run IMAGE command Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/kpod/create.go')
-rw-r--r--cmd/kpod/create.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index bbfeaebae..0a0e31c40 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -319,6 +319,14 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
blkioWeight = uint16(u)
}
+ // 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
+ }
+
config := &createConfig{
capAdd: c.StringSlice("cap-add"),
capDrop: c.StringSlice("cap-drop"),
@@ -387,7 +395,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
storageOpts: c.StringSlice("storage-opt"),
sysctl: sysctl,
tmpfs: c.StringSlice("tmpfs"),
- tty: c.Bool("tty"),
+ tty: tty,
user: uid,
group: gid,
volumes: c.StringSlice("volume"),