mirror of
https://github.com/containers/podman.git
synced 2025-12-09 23:27:09 +08:00
Remove --sync flag from podman rm
Per discussion with Dan, it would be better to automatically handle potential runtime errors by automatically syncing if they occur. Retaining the flag for `ps` makes sense, as we won't even be calling the OCI runtime and as such won't see errors if the state desyncs, but rm can be handled automatically. The automatic desync handling code will take some additional work so we'll land this as-is (sync on ps is enough to solve most desync issues). Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
@@ -20,10 +20,6 @@ var (
|
||||
Usage: "Force removal of a running container. The default is false",
|
||||
},
|
||||
LatestFlag,
|
||||
cli.BoolFlag{
|
||||
Name: "sync",
|
||||
Usage: "Sync container state with OCI runtime before removing",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "volumes, v",
|
||||
Usage: "Remove the volumes associated with the container (Not implemented yet)",
|
||||
@@ -77,12 +73,6 @@ func rmCmd(c *cli.Context) error {
|
||||
for _, container := range delContainers {
|
||||
con := container
|
||||
f := func() error {
|
||||
if c.Bool("sync") {
|
||||
if err := con.Sync(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return runtime.RemoveContainer(ctx, con, c.Bool("force"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user