diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-09 10:55:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 10:55:15 -0400 |
commit | fa01b838a6867c46576afcab35eaefde6e1c4abe (patch) | |
tree | fa5cfaff85733c755c5173b118ce718881b45dbb /cmd | |
parent | 71d675a164ee64111db1a9214673a3498b3aa123 (diff) | |
parent | fea78d5530f996d008912584761433023491f160 (diff) | |
download | podman-fa01b838a6867c46576afcab35eaefde6e1c4abe.tar.gz podman-fa01b838a6867c46576afcab35eaefde6e1c4abe.tar.bz2 podman-fa01b838a6867c46576afcab35eaefde6e1c4abe.zip |
Merge pull request #7891 from rhatdan/rm
This PR allows users to remove external containers directly
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/rm.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go index f8f12234d..a7739b3ba 100644 --- a/cmd/podman/containers/rm.go +++ b/cmd/podman/containers/rm.go @@ -57,13 +57,12 @@ func rmFlags(flags *pflag.FlagSet) { flags.BoolVarP(&rmOptions.All, "all", "a", false, "Remove all containers") flags.BoolVarP(&rmOptions.Ignore, "ignore", "i", false, "Ignore errors when a specified container is missing") flags.BoolVarP(&rmOptions.Force, "force", "f", false, "Force removal of a running or unusable container. The default is false") - flags.BoolVar(&rmOptions.Storage, "storage", false, "Remove container from storage library") flags.BoolVarP(&rmOptions.Volumes, "volumes", "v", false, "Remove anonymous volumes associated with the container") flags.StringArrayVarP(&rmOptions.CIDFiles, "cidfile", "", nil, "Read the container ID from the file") - if registry.IsRemote() { - _ = flags.MarkHidden("ignore") - _ = flags.MarkHidden("cidfile") + if !registry.IsRemote() { + // This option is deprecated, but needs to still exists for backwards compatibility + flags.Bool("storage", false, "Remove container from storage library") _ = flags.MarkHidden("storage") } } @@ -97,12 +96,6 @@ func removeContainers(namesOrIDs []string, rmOptions entities.RmOptions, setExit var ( errs utils.OutputErrors ) - // Storage conflicts with --all/--latest/--volumes/--cidfile/--ignore - if rmOptions.Storage { - if rmOptions.All || rmOptions.Ignore || rmOptions.Latest || rmOptions.Volumes || rmOptions.CIDFiles != nil { - return errors.Errorf("--storage conflicts with --volumes, --all, --latest, --ignore and --cidfile") - } - } responses, err := registry.ContainerEngine().ContainerRm(context.Background(), namesOrIDs, rmOptions) if err != nil { if setExit { |