diff options
author | Marco Vedovati <mvedovati@suse.com> | 2019-07-05 12:54:07 +0200 |
---|---|---|
committer | Marco Vedovati <mvedovati@suse.com> | 2019-09-25 19:44:38 +0200 |
commit | dacbc5beb2a8841e52cf8ea7f544b4d302469c1d (patch) | |
tree | 59789993d8dafec7b96ca1eb7a31b3959c50e7b0 /cmd/podman/rm.go | |
parent | 83b2348313c52cc3e20d72285a9d81d3d72c2d5d (diff) | |
download | podman-dacbc5beb2a8841e52cf8ea7f544b4d302469c1d.tar.gz podman-dacbc5beb2a8841e52cf8ea7f544b4d302469c1d.tar.bz2 podman-dacbc5beb2a8841e52cf8ea7f544b4d302469c1d.zip |
rm: add containers eviction with `rm --force`
Add ability to evict a container when it becomes unusable. This may
happen when the host setup changes after a container creation, making it
impossible for that container to be used or removed.
Evicting a container is done using the `rm --force` command.
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Diffstat (limited to 'cmd/podman/rm.go')
-rw-r--r-- | cmd/podman/rm.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go index 9e3ce4d0b..89062f524 100644 --- a/cmd/podman/rm.go +++ b/cmd/podman/rm.go @@ -13,7 +13,7 @@ var ( rmCommand cliconfig.RmValues rmDescription = fmt.Sprintf(`Removes one or more containers from the host. The container name or ID can be used. - Command does not remove images. Running containers will not be removed without the -f option.`) + Command does not remove images. Running or unusable containers will not be removed without the -f option.`) _rmCommand = &cobra.Command{ Use: "rm [flags] CONTAINER [CONTAINER...]", Short: "Remove one or more containers", @@ -29,7 +29,8 @@ var ( }, Example: `podman rm imageID podman rm mywebserver myflaskserver 860a4b23 - podman rm --force --all`, + podman rm --force --all + podman rm -f c684f0d469f2`, } ) @@ -39,7 +40,7 @@ func init() { rmCommand.SetUsageTemplate(UsageTemplate()) flags := rmCommand.Flags() 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.Force, "force", "f", false, "Force removal of a running or unusable 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") |