diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-20 17:06:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 17:06:36 +0100 |
commit | 3e5699224bf4bbaa7f61681831a8bf36e3d7aec4 (patch) | |
tree | 2efc288f5647a37595d9b84edefc1e2ee3896e12 /pkg/bindings/pods/pods.go | |
parent | e7d8bda8706b98dfc182cf03e294dc1ce83af6d2 (diff) | |
parent | 3db43dcce3479b73b023dee1798a69bc78b15fb8 (diff) | |
download | podman-3e5699224bf4bbaa7f61681831a8bf36e3d7aec4.tar.gz podman-3e5699224bf4bbaa7f61681831a8bf36e3d7aec4.tar.bz2 podman-3e5699224bf4bbaa7f61681831a8bf36e3d7aec4.zip |
Merge pull request #5251 from sujil02/pod-test
Add test to validate the pod bindings api
Diffstat (limited to 'pkg/bindings/pods/pods.go')
-rw-r--r-- | pkg/bindings/pods/pods.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/bindings/pods/pods.go b/pkg/bindings/pods/pods.go index d079f01c2..69d7f21bc 100644 --- a/pkg/bindings/pods/pods.go +++ b/pkg/bindings/pods/pods.go @@ -87,9 +87,9 @@ func Prune(ctx context.Context) error { // List returns all pods in local storage. The optional filters parameter can // be used to refine which pods should be listed. -func List(ctx context.Context, filters map[string][]string) (*[]libpod.PodInspect, error) { +func List(ctx context.Context, filters map[string][]string) ([]*libpod.PodInspect, error) { var ( - inspect []libpod.PodInspect + inspect []*libpod.PodInspect ) conn, err := bindings.GetConnectionFromContext(ctx) if err != nil { @@ -103,11 +103,11 @@ func List(ctx context.Context, filters map[string][]string) (*[]libpod.PodInspec } params["filters"] = stringFilter } - response, err := conn.DoRequest(nil, http.MethodPost, "/pods/json", params) + response, err := conn.DoRequest(nil, http.MethodGet, "/pods/json", params) if err != nil { - return &inspect, err + return inspect, err } - return &inspect, response.Process(&inspect) + return inspect, response.Process(&inspect) } // Restart restarts all containers in a pod. @@ -147,7 +147,7 @@ func Start(ctx context.Context, nameOrID string) error { if err != nil { return err } - response, err := conn.DoRequest(nil, http.MethodDelete, "/pods/%s/start", nil, nameOrID) + response, err := conn.DoRequest(nil, http.MethodPost, "/pods/%s/start", nil, nameOrID) if err != nil { return err } |