summaryrefslogtreecommitdiff
path: root/pkg/bindings/pods
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-22 10:52:55 -0500
committerGitHub <noreply@github.com>2020-02-22 10:52:55 -0500
commit2850ec5f507ee6c3202f09e099b01a4e550ef0d9 (patch)
tree7af4fcba3fec116c025c4d2ab22c83048672a952 /pkg/bindings/pods
parent822bf70e454126475e32034b3ce3c660752b99ad (diff)
parentf0df07b5931b256b0ddadb80a8357985038cfe26 (diff)
downloadpodman-2850ec5f507ee6c3202f09e099b01a4e550ef0d9.tar.gz
podman-2850ec5f507ee6c3202f09e099b01a4e550ef0d9.tar.bz2
podman-2850ec5f507ee6c3202f09e099b01a4e550ef0d9.zip
Merge pull request #5290 from baude/apiv2imagetests2
add more image tests for go bindings
Diffstat (limited to 'pkg/bindings/pods')
-rw-r--r--pkg/bindings/pods/pods.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkg/bindings/pods/pods.go b/pkg/bindings/pods/pods.go
index 838b22e43..1a8c31be1 100644
--- a/pkg/bindings/pods/pods.go
+++ b/pkg/bindings/pods/pods.go
@@ -3,6 +3,7 @@ package pods
import (
"context"
"net/http"
+ "net/url"
"strconv"
"github.com/containers/libpod/libpod"
@@ -48,9 +49,9 @@ func Kill(ctx context.Context, nameOrID string, signal *string) error {
if err != nil {
return err
}
- params := make(map[string]string)
+ params := url.Values{}
if signal != nil {
- params["signal"] = *signal
+ params.Set("signal", *signal)
}
response, err := conn.DoRequest(nil, http.MethodPost, "/pods/%s/kill", params, nameOrID)
if err != nil {
@@ -95,13 +96,13 @@ func List(ctx context.Context, filters map[string][]string) ([]*libpod.PodInspec
if err != nil {
return nil, err
}
- params := make(map[string]string)
+ params := url.Values{}
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, "/pods/json", params)
if err != nil {
@@ -130,9 +131,9 @@ func Remove(ctx context.Context, nameOrID string, force *bool) error {
if err != nil {
return err
}
- params := make(map[string]string)
+ params := url.Values{}
if force != nil {
- params["force"] = strconv.FormatBool(*force)
+ params.Set("force", strconv.FormatBool(*force))
}
response, err := conn.DoRequest(nil, http.MethodDelete, "/pods/%s", params, nameOrID)
if err != nil {
@@ -166,9 +167,9 @@ func Stop(ctx context.Context, nameOrID string, timeout *int) error {
if err != nil {
return err
}
- params := make(map[string]string)
+ params := url.Values{}
if timeout != nil {
- params["t"] = strconv.Itoa(*timeout)
+ params.Set("t", strconv.Itoa(*timeout))
}
response, err := conn.DoRequest(nil, http.MethodPost, "/pods/%s/stop", params, nameOrID)
if err != nil {