aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/utils
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-06-12 05:38:52 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-06-12 06:48:49 -0400
commit99f2a4e4b9c581779fb6ecb1915bb64400bd015d (patch)
tree847626c5ae310c3fb6719f5ab8c2000537f36111 /pkg/api/handlers/utils
parent8aa5cf3d45998bc92eaafd67ab2a59e3722bade4 (diff)
downloadpodman-99f2a4e4b9c581779fb6ecb1915bb64400bd015d.tar.gz
podman-99f2a4e4b9c581779fb6ecb1915bb64400bd015d.tar.bz2
podman-99f2a4e4b9c581779fb6ecb1915bb64400bd015d.zip
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>
Diffstat (limited to 'pkg/api/handlers/utils')
-rw-r--r--pkg/api/handlers/utils/images.go5
1 files changed, 2 insertions, 3 deletions
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 {