diff options
author | Brent Baude <bbaude@redhat.com> | 2020-02-14 12:11:23 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-02-14 12:11:23 -0600 |
commit | 08bb9317cbd1a00b4dd52bc3409699271351403d (patch) | |
tree | 3cc0115bd6fda66dca2baf3df854b1e2bd54aa20 /pkg/api/handlers/utils/images.go | |
parent | 0c060dace19710716ff8f3a65865a295312d9d94 (diff) | |
download | podman-08bb9317cbd1a00b4dd52bc3409699271351403d.tar.gz podman-08bb9317cbd1a00b4dd52bc3409699271351403d.tar.bz2 podman-08bb9317cbd1a00b4dd52bc3409699271351403d.zip |
add caching for binding tests
add the ability to cache images instead of pull them. makes tests faster and less network use when we flip on CI.
Also added list images with filter test
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/utils/images.go')
-rw-r--r-- | pkg/api/handlers/utils/images.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index 2b651584a..d0dfbf3ab 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -31,9 +31,12 @@ func GetImages(w http.ResponseWriter, r *http.Request) ([]*image.Image, error) { if _, found := mux.Vars(r)["digests"]; found && query.Digests { UnSupportedParameter("digests") } - - if _, found := r.URL.Query()["filters"]; found { - filters = append(filters, fmt.Sprintf("reference=%s", "")) + if len(query.Filters) > 0 { + for k, v := range query.Filters { + for _, val := range v { + filters = append(filters, fmt.Sprintf("%s=%s", k, val)) + } + } } return runtime.ImageRuntime().GetImagesWithFilters(filters) } |