From 573ed9220b9b295eacdd017dc87bbb592043cff4 Mon Sep 17 00:00:00 2001 From: Jakub Guzik Date: Thu, 25 Mar 2021 01:32:00 +0100 Subject: Fix filters in image http compat/libpod api endpoints Signed-off-by: Jakub Guzik --- libpod/image/prune.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpod') diff --git a/libpod/image/prune.go b/libpod/image/prune.go index d6ae5feaf..21867698a 100644 --- a/libpod/image/prune.go +++ b/libpod/image/prune.go @@ -2,6 +2,7 @@ package image import ( "context" + "strconv" "strings" "time" @@ -52,6 +53,12 @@ func generatePruneFilterFuncs(filter, filterValue string) (ImageFilter, error) { } return false }, nil + case "dangling": + danglingImages, err := strconv.ParseBool(filterValue) + if err != nil { + return nil, errors.Wrapf(err, "invalid filter dangling=%s", filterValue) + } + return ImageFilter(DanglingFilter(danglingImages)), nil } return nil, nil } -- cgit v1.2.3-54-g00ecf