aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/swarm_task.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/swarm_task.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/swarm_task.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/swarm_task.go b/vendor/github.com/fsouza/go-dockerclient/swarm_task.go
index 547642f5e..9321368d3 100644
--- a/vendor/github.com/fsouza/go-dockerclient/swarm_task.go
+++ b/vendor/github.com/fsouza/go-dockerclient/swarm_task.go
@@ -7,6 +7,7 @@ package docker
import (
"context"
"encoding/json"
+ "errors"
"net/http"
"github.com/docker/docker/api/types/swarm"
@@ -56,7 +57,8 @@ func (c *Client) ListTasks(opts ListTasksOptions) ([]swarm.Task, error) {
func (c *Client) InspectTask(id string) (*swarm.Task, error) {
resp, err := c.do(http.MethodGet, "/tasks/"+id, doOptions{})
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 nil, &NoSuchTask{ID: id}
}
return nil, err