mirror of https://github.com/containers/podman.git
Implement kpod --rm code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #81 Approved by: baude
This commit is contained in:
parent
342ce4db50
commit
ab62fe17ff
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue