From 84907324fa02b8ede502a47b522fc717e782a909 Mon Sep 17 00:00:00 2001 From: Jakub Guzik Date: Wed, 7 Apr 2021 00:02:12 +0200 Subject: Volumes prune endpoint should use only prune filters Volumes endpoints for HTTP compat and libpod APIs allowed usage of list HTTP endpoint filter funcs. Documentation in case of compat API does not allow that. This commit aligns code with the documentation and also ligns libpod with compat API. Signed-off-by: Jakub Guzik --- test/apiv2/30-volumes.at | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/apiv2/30-volumes.at b/test/apiv2/30-volumes.at index 18ff31100..623e691e3 100644 --- a/test/apiv2/30-volumes.at +++ b/test/apiv2/30-volumes.at @@ -123,4 +123,20 @@ t POST libpod/volumes/prune 200 #After prune volumes, there should be no volume existing t GET libpod/volumes/json 200 length=0 +# libpod api: do not use list filters for prune +t POST libpod/volumes/prune?filters='{"name":["anyname"]}' 500 \ + .cause="\"name\" is an invalid volume filter" +t POST libpod/volumes/prune?filters='{"driver":["anydriver"]}' 500 \ + .cause="\"driver\" is an invalid volume filter" +t POST libpod/volumes/prune?filters='{"scope":["anyscope"]}' 500 \ + .cause="\"scope\" is an invalid volume filter" + +# compat api: do not use list filters for prune +t POST volumes/prune?filters='{"name":["anyname"]}' 500 \ + .cause="\"name\" is an invalid volume filter" +t POST volumes/prune?filters='{"driver":["anydriver"]}' 500 \ + .cause="\"driver\" is an invalid volume filter" +t POST volumes/prune?filters='{"scope":["anyscope"]}' 500 \ + .cause="\"scope\" is an invalid volume filter" + # vim: filetype=sh -- cgit v1.2.3-54-g00ecf