diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-14 22:54:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 22:54:56 +0200 |
commit | aa2992dec69c73626a2a57d335b8641f203afd16 (patch) | |
tree | 2199d46fd890b51619e41714ae5ee6a41931a691 /cmd | |
parent | 4a450d55d95fbd02e45206c6c3ef7637d5c49656 (diff) | |
parent | 49e696642d4d2d08bb89d6968f50ef9d6f17361a (diff) | |
download | podman-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 'cmd')
-rw-r--r-- | cmd/podman/cliconfig/config.go | 1 | ||||
-rw-r--r-- | cmd/podman/rm.go | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go index 545166d05..4a4c839cc 100644 --- a/cmd/podman/cliconfig/config.go +++ b/cmd/podman/cliconfig/config.go @@ -439,6 +439,7 @@ type RmValues struct { All bool Force bool Latest bool + Storage bool Volumes bool } diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go index 1bf56b782..2710a8194 100644 --- a/cmd/podman/rm.go +++ b/cmd/podman/rm.go @@ -42,7 +42,9 @@ func init() { flags.BoolVarP(&rmCommand.All, "all", "a", false, "Remove all containers") flags.BoolVarP(&rmCommand.Force, "force", "f", false, "Force removal of a running container. The default is false") flags.BoolVarP(&rmCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of") + flags.BoolVar(&rmCommand.Storage, "storage", false, "Remove container from storage library") flags.BoolVarP(&rmCommand.Volumes, "volumes", "v", false, "Remove the volumes associated with the container") + markFlagHiddenForRemoteClient("storage", flags) markFlagHiddenForRemoteClient("latest", flags) } @@ -54,6 +56,13 @@ func rmCmd(c *cliconfig.RmValues) error { } defer runtime.Shutdown(false) + // Storage conflicts with --all/--latest/--volumes + if c.Storage { + if c.All || c.Latest || c.Volumes { + return errors.Errorf("--storage conflicts with --volumes, --all, and --latest") + } + } + ok, failures, err := runtime.RemoveContainers(getContext(), c) if err != nil { if errors.Cause(err) == libpod.ErrNoSuchCtr { |