diff options
Diffstat (limited to 'pkg/api/handlers/utils/images.go')
-rw-r--r-- | pkg/api/handlers/utils/images.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index 2b651584a..f68a71561 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -32,8 +32,15 @@ func GetImages(w http.ResponseWriter, r *http.Request) ([]*image.Image, error) { 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) + } else { + return runtime.ImageRuntime().GetImages() } - return runtime.ImageRuntime().GetImagesWithFilters(filters) + } |