From 610118d9bf4ee28d50d3042d9578b3cef24fd86e Mon Sep 17 00:00:00 2001 From: "Korhonen Sami (Samlink)" Date: Tue, 7 Jul 2020 11:31:32 +0300 Subject: Add support for Filter query parameter to list images api Docker api version 1.24 uses a query parameter named Filter for filtering images by names. In more recent versions of api name filter is in filters query parameter with other filters This patch adds a mapping that translates Filter query parameter to Filters={"reference": [""]} Signed-off-by: Sami Korhonen --- test/apiv2/10-images.at | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/apiv2/10-images.at') diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at index 1c7ba8948..a204df65c 100644 --- a/test/apiv2/10-images.at +++ b/test/apiv2/10-images.at @@ -26,6 +26,14 @@ t GET libpod/images/${iid:0:12}/json 200 \ .Id=$iid \ .RepoTags[0]=$IMAGE +# Docker API V1.24 filter parameter compatibility +t GET images/json?filter=$IMAGE 200 \ + length=1 \ + .[0].Names[0]=$IMAGE + +# Negative test case +t GET images/json?filter=nonesuch 200 length=0 + # FIXME: docker API incompatibility: libpod returns 'id', docker 'sha256:id' t GET images/$iid/json 200 \ .Id=sha256:$iid \ -- cgit v1.2.3-54-g00ecf