aboutsummaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-24 13:12:06 +0100
committerGitHub <noreply@github.com>2020-03-24 13:12:06 +0100
commit3dbf2cb5aff67f82e486cd95aca170e44b8fc75a (patch)
tree0e67d02bcdb5caed701c22b332a4ad6f2bbe6fe6 /pkg/bindings
parenta2ffd5c230ea6f53ed40ccc60e869164fee41899 (diff)
parent9536560b4f3a38fbba4ac61c357dd3627fb6cf4e (diff)
downloadpodman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.tar.gz
podman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.tar.bz2
podman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.zip
Merge pull request #5581 from baude/v2containers
podmanv2 add core container commands
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)