mirror of
https://github.com/containers/podman.git
synced 2025-09-27 16:54:42 +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"))
|
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{
|
config := &createConfig{
|
||||||
runtime: runtime,
|
runtime: runtime,
|
||||||
capAdd: c.StringSlice("cap-add"),
|
capAdd: c.StringSlice("cap-add"),
|
||||||
|
@ -136,5 +136,8 @@ func runCmd(c *cli.Context) error {
|
|||||||
fmt.Printf("%s\n", ctr.ID())
|
fmt.Printf("%s\n", ctr.ID())
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
if createConfig.rm {
|
||||||
|
return runtime.RemoveContainer(ctr, true)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user