mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
Implement kpod --rm code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #81 Approved by: baude
This commit is contained in:

committed by
Atomic Bot

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
|
||||
}
|
||||
|
Reference in New Issue
Block a user