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 <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2020-06-12 05:38:52 -04:00
parent 8aa5cf3d45
commit 99f2a4e4b9
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028
1 changed files with 2 additions and 3 deletions

View File

@ -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 {