From 83db80ce172975ddb7c5bfc0d1cea03d5c6b6c94 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 26 Feb 2019 12:16:58 -0500 Subject: Only remove image volumes when removing containers When removing volumes with rm --volumes we want to only remove volumes that were created with the container. Volumes created separately via 'podman volume create' should not be removed. Also ensure that --rm implies volumes will be removed. Fixes #2441 Signed-off-by: Matthew Heon --- cmd/podman/cleanup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/podman/cleanup.go b/cmd/podman/cleanup.go index d68255aa2..33d456643 100644 --- a/cmd/podman/cleanup.go +++ b/cmd/podman/cleanup.go @@ -60,7 +60,7 @@ func cleanupCmd(c *cliconfig.CleanupValues) error { for _, ctr := range cleanupContainers { hadError := false if c.Remove { - if err := runtime.RemoveContainer(ctx, ctr, false, false); err != nil { + if err := runtime.RemoveContainer(ctx, ctr, false, true); err != nil { if lastError != nil { fmt.Fprintln(os.Stderr, lastError) } -- cgit v1.2.3-54-g00ecf