summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-08 23:03:55 +0200
committerGitHub <noreply@github.com>2019-05-08 23:03:55 +0200
commit627dbd49c5a80146e5806797243b63d0bd157760 (patch)
tree00d12b9fd9a0075aa4eb25a873310fb39026d7ff /pkg/adapter/containers.go
parent49e09ddbf5a17eab025f661d4f57e5868181d57a (diff)
parent5c6ff901ba54656b54a0cc40306d94c7c55b8454 (diff)
downloadpodman-627dbd49c5a80146e5806797243b63d0bd157760.tar.gz
podman-627dbd49c5a80146e5806797243b63d0bd157760.tar.bz2
podman-627dbd49c5a80146e5806797243b63d0bd157760.zip
Merge pull request #3072 from mheon/no_rm_volume
Do not remove volumes when --rm removes a container
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 82d999202..ff7b6377a 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -413,7 +413,9 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
}
if c.IsSet("rm") {
- r.Runtime.RemoveContainer(ctx, ctr, false, true)
+ if err := r.Runtime.RemoveContainer(ctx, ctr, false, false); err != nil {
+ logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ }
}
return exitCode, nil
@@ -965,8 +967,9 @@ func (r *LocalRuntime) CleanupContainers(ctx context.Context, cli *cliconfig.Cle
return ok, failures, nil
}
+// Only used when cleaning up containers
func removeContainer(ctx context.Context, ctr *libpod.Container, runtime *LocalRuntime) error {
- if err := runtime.RemoveContainer(ctx, ctr, false, true); err != nil {
+ if err := runtime.RemoveContainer(ctx, ctr, false, false); err != nil {
return errors.Wrapf(err, "failed to cleanup and remove container %v", ctr.ID())
}
return nil