From 99f2a4e4b9c581779fb6ecb1915bb64400bd015d Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 12 Jun 2020 05:38:52 -0400 Subject: Reassemble filters on the server side --filter label=foo=bar, was been translated on the server side to --filter label=foo --filter=bar This PR fixes this back to what the user specified. Signed-off-by: Daniel J Walsh --- pkg/api/handlers/utils/images.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pkg/api/handlers/utils/images.go') diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go index 7fb31a177..8570f66fc 100644 --- a/pkg/api/handlers/utils/images.go +++ b/pkg/api/handlers/utils/images.go @@ -3,6 +3,7 @@ package utils import ( "fmt" "net/http" + "strings" "github.com/containers/image/v5/docker" "github.com/containers/image/v5/storage" @@ -77,9 +78,7 @@ func GetImages(w http.ResponseWriter, r *http.Request) ([]*image.Image, error) { if len(query.Filters) > 0 { for k, v := range query.Filters { - for _, val := range v { - filters = append(filters, fmt.Sprintf("%s=%s", k, val)) - } + filters = append(filters, fmt.Sprintf("%s=%s", k, strings.Join(v, "="))) } images, err = runtime.ImageRuntime().GetImagesWithFilters(filters) if err != nil { -- cgit v1.2.3-54-g00ecf