aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/imagefilters
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-07-17 10:49:03 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-07-19 06:59:49 -0400
commit8ae97b2f57a845dd05f70f244a763c53250b4e81 (patch)
tree002608749a0930e7a75a6213217a9f09461eec71 /cmd/podman/imagefilters
parent398aeac8537e82ca813bb77e44ddfcefa5cc5ad5 (diff)
downloadpodman-8ae97b2f57a845dd05f70f244a763c53250b4e81.tar.gz
podman-8ae97b2f57a845dd05f70f244a763c53250b4e81.tar.bz2
podman-8ae97b2f57a845dd05f70f244a763c53250b4e81.zip
Add support for listing read/only and read/write images
When removing --all images prune images only attempt to remove read/write images, ignore read/only images Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/imagefilters')
-rw-r--r--cmd/podman/imagefilters/filters.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/imagefilters/filters.go b/cmd/podman/imagefilters/filters.go
index aa5776599..0b08314ce 100644
--- a/cmd/podman/imagefilters/filters.go
+++ b/cmd/podman/imagefilters/filters.go
@@ -46,6 +46,16 @@ func DanglingFilter(danglingImages bool) ResultFilter {
}
}
+// ReadOnlyFilter allows you to filter images based on read/only and read/write
+func ReadOnlyFilter(readOnly bool) ResultFilter {
+ return func(i *adapter.ContainerImage) bool {
+ if readOnly {
+ return i.IsReadOnly()
+ }
+ return !i.IsReadOnly()
+ }
+}
+
// LabelFilter allows you to filter by images labels key and/or value
func LabelFilter(ctx context.Context, labelfilter string) ResultFilter {
// We need to handle both label=key and label=key=value