summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-12-09 12:35:57 -0600
committerbaude <bbaude@redhat.com>2019-12-10 13:05:18 -0600
commit8be7b466d86b53d170f82a4bd94667c4db71db59 (patch)
tree023eaca098ed07efb13174c5a942784e04a78a0d /libpod/image/image.go
parentc2dab75f0ec1502e075cf5174d1b308267648fda (diff)
downloadpodman-8be7b466d86b53d170f82a4bd94667c4db71db59.tar.gz
podman-8be7b466d86b53d170f82a4bd94667c4db71db59.tar.bz2
podman-8be7b466d86b53d170f82a4bd94667c4db71db59.zip
move image filters under libpod/images
to make things more effecient for the api work we are doing, we should process image filters internally (as opposed to in main). this allows for better api responses and more closely affiliated functions. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 129ccd376..c8583a1c5 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -216,6 +216,19 @@ func (ir *Runtime) Shutdown(force bool) error {
return err
}
+// GetImagesWithFilters gets images with a series of filters applied
+func (ir *Runtime) GetImagesWithFilters(filters []string) ([]*Image, error) {
+ filterFuncs, err := ir.createFilterFuncs(filters, nil)
+ if err != nil {
+ return nil, err
+ }
+ images, err := ir.GetImages()
+ if err != nil {
+ return nil, err
+ }
+ return FilterImages(images, filterFuncs), nil
+}
+
func (i *Image) reloadImage() error {
newImage, err := i.imageruntime.getImage(i.ID())
if err != nil {