summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-14 22:54:56 +0200
committerGitHub <noreply@github.com>2019-06-14 22:54:56 +0200
commitaa2992dec69c73626a2a57d335b8641f203afd16 (patch)
tree2199d46fd890b51619e41714ae5ee6a41931a691 /pkg/adapter/containers.go
parent4a450d55d95fbd02e45206c6c3ef7637d5c49656 (diff)
parent49e696642d4d2d08bb89d6968f50ef9d6f17361a (diff)
downloadpodman-aa2992dec69c73626a2a57d335b8641f203afd16.tar.gz
podman-aa2992dec69c73626a2a57d335b8641f203afd16.tar.bz2
podman-aa2992dec69c73626a2a57d335b8641f203afd16.zip
Merge pull request #3330 from mheon/remote_storage
Add --storage flag to 'podman rm' (local only)
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 29297fbd5..40b1e6b43 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -190,12 +190,18 @@ func (r *LocalRuntime) RemoveContainers(ctx context.Context, cli *cliconfig.RmVa
}
logrus.Debugf("Setting maximum rm workers to %d", maxWorkers)
+ if cli.Storage {
+ for _, ctr := range cli.InputArgs {
+ if err := r.RemoveStorageContainer(ctr, cli.Force); err != nil {
+ failures[ctr] = err
+ }
+ ok = append(ok, ctr)
+ }
+ return ok, failures, nil
+ }
+
ctrs, err := shortcuts.GetContainersByContext(cli.All, cli.Latest, cli.InputArgs, r.Runtime)
if err != nil {
- // Force may be used to remove containers no longer found in the database
- if cli.Force && len(cli.InputArgs) > 0 && errors.Cause(err) == libpod.ErrNoSuchCtr {
- r.RemoveContainersFromStorage(cli.InputArgs)
- }
return ok, failures, err
}