From 9536560b4f3a38fbba4ac61c357dd3627fb6cf4e Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Sat, 21 Mar 2020 13:47:07 -0500 Subject: podmanv2 add core container commands add core container commands for podmanv2: kill, pause, restart, rm, stop, unpause Signed-off-by: Brent Baude --- pkg/bindings/containers/containers.go | 8 ++++---- pkg/bindings/test/volumes_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/bindings') diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go index 534555a00..231b6f232 100644 --- a/pkg/bindings/containers/containers.go +++ b/pkg/bindings/containers/containers.go @@ -126,13 +126,13 @@ func Inspect(ctx context.Context, nameOrID string, size *bool) (*libpod.InspectC // Kill sends a given signal to a given container. The signal should be the string // representation of a signal like 'SIGKILL'. The nameOrID can be a container name // or a partial/full ID -func Kill(ctx context.Context, nameOrID string, signal string) error { +func Kill(ctx context.Context, nameOrID string, sig string) error { conn, err := bindings.GetClient(ctx) if err != nil { return err } params := url.Values{} - params.Set("signal", signal) + params.Set("signal", sig) response, err := conn.DoRequest(nil, http.MethodPost, "/containers/%s/kill", params, nameOrID) if err != nil { return err @@ -247,14 +247,14 @@ func Exists(ctx context.Context, nameOrID string) (bool, error) { // Stop stops a running container. The timeout is optional. The nameOrID can be a container name // or a partial/full ID -func Stop(ctx context.Context, nameOrID string, timeout *int) error { +func Stop(ctx context.Context, nameOrID string, timeout *uint) error { params := url.Values{} conn, err := bindings.GetClient(ctx) if err != nil { return err } if timeout != nil { - params.Set("t", strconv.Itoa(*timeout)) + params.Set("t", strconv.Itoa(int(*timeout))) } response, err := conn.DoRequest(nil, http.MethodPost, "/containers/%s/stop", params, nameOrID) if err != nil { diff --git a/pkg/bindings/test/volumes_test.go b/pkg/bindings/test/volumes_test.go index 9da034d24..59fe48f22 100644 --- a/pkg/bindings/test/volumes_test.go +++ b/pkg/bindings/test/volumes_test.go @@ -102,7 +102,7 @@ var _ = Describe("Podman volumes", func() { Expect(code).To(BeNumerically("==", http.StatusConflict)) // Removing with a volume in use with force should work with a stopped container - zero := 0 + zero := uint(0) err = containers.Stop(connText, "vtest", &zero) Expect(err).To(BeNil()) err = volumes.Remove(connText, vol.Name, &bindings.PTrue) -- cgit v1.2.3-54-g00ecf