summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/kpod/create.go4
-rw-r--r--cmd/kpod/run.go3
2 files changed, 7 insertions, 0 deletions
diff --git a/cmd/kpod/create.go b/cmd/kpod/create.go
index 2812874fa..c310ab831 100644
--- a/cmd/kpod/create.go
+++ b/cmd/kpod/create.go
@@ -355,6 +355,10 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
return nil, errors.Errorf("--pid %q is not valid", c.String("pid"))
}
+ if c.Bool("detach") && c.Bool("rm") {
+ return nil, errors.Errorf("--rm and --detach can not be specified together")
+ }
+
config := &createConfig{
runtime: runtime,
capAdd: c.StringSlice("cap-add"),
diff --git a/cmd/kpod/run.go b/cmd/kpod/run.go
index b79ba5121..ec68d8b97 100644
--- a/cmd/kpod/run.go
+++ b/cmd/kpod/run.go
@@ -136,5 +136,8 @@ func runCmd(c *cli.Context) error {
fmt.Printf("%s\n", ctr.ID())
}
wg.Wait()
+ if createConfig.rm {
+ return runtime.RemoveContainer(ctr, true)
+ }
return nil
}