diff --git a/client/checkpoint_list_test.go b/client/checkpoint_list_test.go index 388465715b..11426ede44 100644 --- a/client/checkpoint_list_test.go +++ b/client/checkpoint_list_test.go @@ -62,7 +62,7 @@ func TestCheckpointListContainerNotFound(t *testing.T) { } _, err := client.CheckpointList(context.Background(), "unknown", types.CheckpointListOptions{}) - if err == nil || !IsErrContainerNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a containerNotFound error, got %v", err) } } diff --git a/client/config_inspect_test.go b/client/config_inspect_test.go index 010b188413..fab0c286f5 100644 --- a/client/config_inspect_test.go +++ b/client/config_inspect_test.go @@ -42,7 +42,7 @@ func TestConfigInspectConfigNotFound(t *testing.T) { } _, _, err := client.ConfigInspectWithRaw(context.Background(), "unknown") - if err == nil || !IsErrConfigNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a configNotFoundError error, got %v", err) } } @@ -53,7 +53,7 @@ func TestConfigInspect(t *testing.T) { version: "1.30", client: newMockClient(func(req *http.Request) (*http.Response, error) { if !strings.HasPrefix(req.URL.Path, expectedURL) { - return nil, fmt.Errorf("Expected URL '%s', got '%s'", expectedURL, req.URL) + return nil, fmt.Errorf("expected URL '%s', got '%s'", expectedURL, req.URL) } content, err := json.Marshal(swarm.Config{ ID: "config_id", diff --git a/client/container_create_test.go b/client/container_create_test.go index 3ab608c21e..9464dc6243 100644 --- a/client/container_create_test.go +++ b/client/container_create_test.go @@ -37,7 +37,7 @@ func TestContainerCreateImageNotFound(t *testing.T) { client: newMockClient(errorMock(http.StatusNotFound, "No such image")), } _, err := client.ContainerCreate(context.Background(), &container.Config{Image: "unknown_image"}, nil, nil, "unknown") - if err == nil || !IsErrImageNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected an imageNotFound error, got %v", err) } } diff --git a/client/container_inspect_test.go b/client/container_inspect_test.go index 98f83bd8db..37259e40bd 100644 --- a/client/container_inspect_test.go +++ b/client/container_inspect_test.go @@ -30,7 +30,7 @@ func TestContainerInspectContainerNotFound(t *testing.T) { } _, err := client.ContainerInspect(context.Background(), "unknown") - if err == nil || !IsErrContainerNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a containerNotFound error, got %v", err) } } diff --git a/client/errors.go b/client/errors.go index ba29bce679..e41b728d3a 100644 --- a/client/errors.go +++ b/client/errors.go @@ -71,38 +71,6 @@ func wrapResponseError(err error, resp serverResponse, object, id string) error } } -// IsErrImageNotFound returns true if the error is caused -// when an image is not found in the docker host. -// -// Deprecated: Use IsErrNotFound -func IsErrImageNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrContainerNotFound returns true if the error is caused -// when a container is not found in the docker host. -// -// Deprecated: Use IsErrNotFound -func IsErrContainerNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrNetworkNotFound returns true if the error is caused -// when a network is not found in the docker host. -// -// Deprecated: Use IsErrNotFound -func IsErrNetworkNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrVolumeNotFound returns true if the error is caused -// when a volume is not found in the docker host. -// -// Deprecated: Use IsErrNotFound -func IsErrVolumeNotFound(err error) bool { - return IsErrNotFound(err) -} - // unauthorizedError represents an authorization error in a remote registry. type unauthorizedError struct { cause error @@ -120,30 +88,6 @@ func IsErrUnauthorized(err error) bool { return ok } -// IsErrNodeNotFound returns true if the error is caused -// when a node is not found. -// -// Deprecated: Use IsErrNotFound -func IsErrNodeNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrServiceNotFound returns true if the error is caused -// when a service is not found. -// -// Deprecated: Use IsErrNotFound -func IsErrServiceNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrTaskNotFound returns true if the error is caused -// when a task is not found. -// -// Deprecated: Use IsErrNotFound -func IsErrTaskNotFound(err error) bool { - return IsErrNotFound(err) -} - type pluginPermissionDenied struct { name string } @@ -187,27 +131,3 @@ func (cli *Client) NewVersionError(APIrequired, feature string) error { } return nil } - -// IsErrSecretNotFound returns true if the error is caused -// when a secret is not found. -// -// Deprecated: Use IsErrNotFound -func IsErrSecretNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrConfigNotFound returns true if the error is caused -// when a config is not found. -// -// Deprecated: Use IsErrNotFound -func IsErrConfigNotFound(err error) bool { - return IsErrNotFound(err) -} - -// IsErrPluginNotFound returns true if the error is caused -// when a plugin is not found in the docker host. -// -// Deprecated: Use IsErrNotFound -func IsErrPluginNotFound(err error) bool { - return IsErrNotFound(err) -} diff --git a/client/image_inspect_test.go b/client/image_inspect_test.go index 74a4e49805..b5721f39fe 100644 --- a/client/image_inspect_test.go +++ b/client/image_inspect_test.go @@ -31,7 +31,7 @@ func TestImageInspectImageNotFound(t *testing.T) { } _, _, err := client.ImageInspectWithRaw(context.Background(), "unknown") - if err == nil || !IsErrImageNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected an imageNotFound error, got %v", err) } } diff --git a/client/node_inspect_test.go b/client/node_inspect_test.go index dca16a8cdc..6260da517d 100644 --- a/client/node_inspect_test.go +++ b/client/node_inspect_test.go @@ -30,7 +30,7 @@ func TestNodeInspectNodeNotFound(t *testing.T) { } _, _, err := client.NodeInspectWithRaw(context.Background(), "unknown") - if err == nil || !IsErrNodeNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a nodeNotFoundError error, got %v", err) } } diff --git a/client/secret_inspect_test.go b/client/secret_inspect_test.go index 1581da1015..66dbb48d83 100644 --- a/client/secret_inspect_test.go +++ b/client/secret_inspect_test.go @@ -42,7 +42,7 @@ func TestSecretInspectSecretNotFound(t *testing.T) { } _, _, err := client.SecretInspectWithRaw(context.Background(), "unknown") - if err == nil || !IsErrSecretNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a secretNotFoundError error, got %v", err) } } diff --git a/client/service_inspect_test.go b/client/service_inspect_test.go index d53f583e90..ade62535ca 100644 --- a/client/service_inspect_test.go +++ b/client/service_inspect_test.go @@ -31,7 +31,7 @@ func TestServiceInspectServiceNotFound(t *testing.T) { } _, _, err := client.ServiceInspectWithRaw(context.Background(), "unknown", types.ServiceInspectOptions{}) - if err == nil || !IsErrServiceNotFound(err) { + if err == nil || !IsErrNotFound(err) { t.Fatalf("expected a serviceNotFoundError error, got %v", err) } }