summaryrefslogtreecommitdiff
path: root/cmd/podman/images_prune.go
diff options
context:
space:
mode:
authorKunal Kushwaha <kunal.kushwaha@gmail.com>2019-11-14 17:30:46 +0900
committerKunal Kushwaha <kunal.kushwaha@gmail.com>2019-11-22 17:36:27 +0900
commit5082496cc05a11d72e8658cce857523df41c203f (patch)
tree7a0df9ec7788943e423087d2b95609b398c96e83 /cmd/podman/images_prune.go
parentc200583f31d624fb42897d4083edc611b40a93d5 (diff)
downloadpodman-5082496cc05a11d72e8658cce857523df41c203f.tar.gz
podman-5082496cc05a11d72e8658cce857523df41c203f.tar.bz2
podman-5082496cc05a11d72e8658cce857523df41c203f.zip
filter added to image pruge command.
filter option accepts two filters. - label - until label supports "label=value" or "label=key=value" format until supports all golang compatible time/duration formats. Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
Diffstat (limited to 'cmd/podman/images_prune.go')
-rw-r--r--cmd/podman/images_prune.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/images_prune.go b/cmd/podman/images_prune.go
index 9c0a18c41..2b498f83d 100644
--- a/cmd/podman/images_prune.go
+++ b/cmd/podman/images_prune.go
@@ -38,6 +38,7 @@ func init() {
flags := pruneImagesCommand.Flags()
flags.BoolVarP(&pruneImagesCommand.All, "all", "a", false, "Remove all unused images, not just dangling ones")
flags.BoolVarP(&pruneImagesCommand.Force, "force", "f", false, "Do not prompt for confirmation")
+ flags.StringArrayVar(&pruneImagesCommand.Filter, "filter", []string{}, "Provide filter values (e.g. 'label=<key>=<value>')")
}
func pruneImagesCmd(c *cliconfig.PruneImagesValues) error {
@@ -62,7 +63,7 @@ Are you sure you want to continue? [y/N] `)
// Call prune; if any cids are returned, print them and then
// return err in case an error also came up
- pruneCids, err := runtime.PruneImages(getContext(), c.All)
+ pruneCids, err := runtime.PruneImages(getContext(), c.All, c.Filter)
if len(pruneCids) > 0 {
for _, cid := range pruneCids {
fmt.Println(cid)