summaryrefslogtreecommitdiff
path: root/cmd/podman/containers_prune.go
diff options
context:
space:
mode:
authorKunal Kushwaha <kunal.kushwaha@gmail.com>2019-11-29 14:28:34 +0900
committerKunal Kushwaha <kunal.kushwaha@gmail.com>2019-11-29 15:28:55 +0900
commit10c37a2c93c76fb698e41dbdf076793c9a16d02b (patch)
treec37aebdb60b93c42b1c8c79894dec6828f3ad047 /cmd/podman/containers_prune.go
parent0602ce4dc04ec1b78724019e03066b8562877b73 (diff)
downloadpodman-10c37a2c93c76fb698e41dbdf076793c9a16d02b.tar.gz
podman-10c37a2c93c76fb698e41dbdf076793c9a16d02b.tar.bz2
podman-10c37a2c93c76fb698e41dbdf076793c9a16d02b.zip
filter added to container prune command
filter flag helps to filter the containers based on labels, until(time), name, etc for prune command. Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
Diffstat (limited to 'cmd/podman/containers_prune.go')
-rw-r--r--cmd/podman/containers_prune.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/containers_prune.go b/cmd/podman/containers_prune.go
index e18c829e0..78c50268c 100644
--- a/cmd/podman/containers_prune.go
+++ b/cmd/podman/containers_prune.go
@@ -41,6 +41,7 @@ func init() {
pruneContainersCommand.SetUsageTemplate(UsageTemplate())
flags := pruneContainersCommand.Flags()
flags.BoolVarP(&pruneContainersCommand.Force, "force", "f", false, "Force removal of a running container. The default is false")
+ flags.StringArrayVar(&pruneContainersCommand.Filter, "filter", []string{}, "Provide filter values (e.g. 'until=<timestamp>')")
}
func pruneContainersCmd(c *cliconfig.PruneContainersValues) error {
@@ -67,7 +68,7 @@ Are you sure you want to continue? [y/N] `)
if c.GlobalIsSet("max-workers") {
maxWorkers = c.GlobalFlags.MaxWorks
}
- ok, failures, err := runtime.Prune(getContext(), maxWorkers, c.Force)
+ ok, failures, err := runtime.Prune(getContext(), maxWorkers, c.Force, c.Filter)
if err != nil {
if errors.Cause(err) == define.ErrNoSuchCtr {
if len(c.InputArgs) > 1 {