summaryrefslogtreecommitdiff
path: root/cmd/kpod/create.go
diff options
context:
space:
mode:
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"),