summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-21 13:47:07 -0500
committerBrent Baude <bbaude@redhat.com>2020-03-22 13:24:45 -0500
commit9536560b4f3a38fbba4ac61c357dd3627fb6cf4e (patch)
tree8d8cf1471d590752357f06088044d1dcf752ee70 /pkg/bindings
parent2ffff3c6abacad855ce7ddf8290514ebe1424d7f (diff)
downloadpodman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.tar.gz
podman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.tar.bz2
podman-9536560b4f3a38fbba4ac61c357dd3627fb6cf4e.zip
podmanv2 add core container commands
add core container commands for podmanv2: kill, pause, restart, rm, stop, unpause Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/containers/containers.go8
-rw-r--r--pkg/bindings/test/volumes_test.go2
2 files changed, 5 insertions, 5 deletions
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)