From 034cc8a5aeac5c6df39e7b4b7229f95803159542 Mon Sep 17 00:00:00 2001 From: Kunal Kushwaha Date: Wed, 10 Apr 2019 13:50:12 +0900 Subject: imagefilter dangling handling corrected imagefilter dangling= shall not be ignored. this PR handles the value and returns images accordingly. Signed-off-by: Kunal Kushwaha --- cmd/podman/imagefilters/filters.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cmd/podman/imagefilters') diff --git a/cmd/podman/imagefilters/filters.go b/cmd/podman/imagefilters/filters.go index 2932d61c0..aa5776599 100644 --- a/cmd/podman/imagefilters/filters.go +++ b/cmd/podman/imagefilters/filters.go @@ -37,9 +37,12 @@ func CreatedAfterFilter(createTime time.Time) ResultFilter { } // DanglingFilter allows you to filter images for dangling images -func DanglingFilter() ResultFilter { +func DanglingFilter(danglingImages bool) ResultFilter { return func(i *adapter.ContainerImage) bool { - return i.Dangling() + if danglingImages { + return i.Dangling() + } + return !i.Dangling() } } -- cgit v1.2.3-54-g00ecf