diff options
author | Brent Baude <bbaude@redhat.com> | 2020-02-21 12:32:42 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-02-21 16:11:39 -0600 |
commit | f0df07b5931b256b0ddadb80a8357985038cfe26 (patch) | |
tree | 5bc5132d488fe285d64d6b517d587a8c68ea38cd /pkg/bindings/images/search.go | |
parent | f51cf8546d17c68f5ade1b4c8558d120c583316e (diff) | |
download | podman-f0df07b5931b256b0ddadb80a8357985038cfe26.tar.gz podman-f0df07b5931b256b0ddadb80a8357985038cfe26.tar.bz2 podman-f0df07b5931b256b0ddadb80a8357985038cfe26.zip |
add more image tests for go bindings
adding more image tests for go bindings. one big change is that the params were converted from map[string]string to url.values to account for the ability to send []string as query params
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/images/search.go')
-rw-r--r-- | pkg/bindings/images/search.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/bindings/images/search.go b/pkg/bindings/images/search.go index dca1b0e63..183ff3d77 100644 --- a/pkg/bindings/images/search.go +++ b/pkg/bindings/images/search.go @@ -3,6 +3,7 @@ package images import ( "context" "net/http" + "net/url" "strconv" "github.com/containers/libpod/libpod/image" @@ -20,17 +21,17 @@ func Search(ctx context.Context, term string, limit *int, filters map[string][]s if err != nil { return nil, err } - params := make(map[string]string) - params["term"] = term + params := url.Values{} + params.Set("term", term) if limit != nil { - params["limit"] = strconv.Itoa(*limit) + params.Set("limit", strconv.Itoa(*limit)) } if filters != nil { stringFilter, err := bindings.FiltersToString(filters) if err != nil { return nil, err } - params["filters"] = stringFilter + params.Set("filters", stringFilter) } response, err := conn.DoRequest(nil, http.MethodGet, "/images/search", params) if err != nil { |