diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-11-19 13:13:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-19 13:13:51 +0100 |
commit | f3f219a67c3a9297b5e1f0505c583b9de35661c8 (patch) | |
tree | 069f51f6a50d5234e6bc16f2045656aaefb9b313 /cmd/podman/rm.go | |
parent | 741b90c2b95c533f2ee5669ae1d3b2a93c8129ce (diff) | |
parent | 061bf77588c573668646fb07ded748c9bf375130 (diff) | |
download | podman-f3f219a67c3a9297b5e1f0505c583b9de35661c8.tar.gz podman-f3f219a67c3a9297b5e1f0505c583b9de35661c8.tar.bz2 podman-f3f219a67c3a9297b5e1f0505c583b9de35661c8.zip |
Merge pull request #4523 from vrothberg/systemd-improvements
podman rm/stop --cidfile
Diffstat (limited to 'cmd/podman/rm.go')
-rw-r--r-- | cmd/podman/rm.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/podman/rm.go b/cmd/podman/rm.go index 6329a9d8e..b3bc8e1b9 100644 --- a/cmd/podman/rm.go +++ b/cmd/podman/rm.go @@ -25,7 +25,7 @@ var ( return rmCmd(&rmCommand) }, Args: func(cmd *cobra.Command, args []string) error { - return checkAllAndLatest(cmd, args, false) + return checkAllLatestAndCIDFile(cmd, args, false, true) }, Example: `podman rm imageID podman rm mywebserver myflaskserver 860a4b23 @@ -44,8 +44,10 @@ func init() { 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 anonymous volumes associated with the container") + flags.StringArrayVarP(&rmCommand.CIDFiles, "cidfile", "", nil, "Read the container ID from the file") markFlagHiddenForRemoteClient("storage", flags) markFlagHiddenForRemoteClient("latest", flags) + markFlagHiddenForRemoteClient("cidfile", flags) } // rmCmd removes one or more containers @@ -58,8 +60,8 @@ func rmCmd(c *cliconfig.RmValues) error { // 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") + if c.All || c.Latest || c.Volumes || c.CIDFiles != nil { + return errors.Errorf("--storage conflicts with --volumes, --all, --latest and --cidfile") } } |