summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/container_stop.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-29 20:36:07 +0000
committerGitHub <noreply@github.com>2021-03-29 20:36:07 +0000
commitf24fabba13df6d442b120cb88fa57287ab85e2de (patch)
tree109299ef9cd051e08380119b41288f970443ed2a /vendor/github.com/fsouza/go-dockerclient/container_stop.go
parentc8af1747320bb9506ab4ea80892f0dae81c03a95 (diff)
parent1386f90467e9111533742b40f91018f908efea81 (diff)
downloadpodman-f24fabba13df6d442b120cb88fa57287ab85e2de.tar.gz
podman-f24fabba13df6d442b120cb88fa57287ab85e2de.tar.bz2
podman-f24fabba13df6d442b120cb88fa57287ab85e2de.zip
Merge pull request #9868 from mheon/310_backports
Final backports for v3.1.0
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/container_stop.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/container_stop.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/container_stop.go b/vendor/github.com/fsouza/go-dockerclient/container_stop.go
index 0b148b084..43d989874 100644
--- a/vendor/github.com/fsouza/go-dockerclient/container_stop.go
+++ b/vendor/github.com/fsouza/go-dockerclient/container_stop.go
@@ -2,6 +2,7 @@ package docker
import (
"context"
+ "errors"
"fmt"
"net/http"
)
@@ -19,7 +20,6 @@ func (c *Client) StopContainer(id string, timeout uint) error {
// container request.
//
// See https://goo.gl/R9dZcV for more details.
-//nolint:golint
func (c *Client) StopContainerWithContext(id string, timeout uint, ctx context.Context) error {
return c.stopContainer(id, timeout, doOptions{context: ctx})
}
@@ -28,7 +28,8 @@ func (c *Client) stopContainer(id string, timeout uint, opts doOptions) error {
path := fmt.Sprintf("/containers/%s/stop?t=%d", id, timeout)
resp, err := c.do(http.MethodPost, path, opts)
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return &NoSuchContainer{ID: id}
}
return err