diff --git a/client/service_create_test.go b/client/service_create_test.go index 4af7d618c2..fe8191539f 100644 --- a/client/service_create_test.go +++ b/client/service_create_test.go @@ -10,9 +10,9 @@ import ( "strings" "testing" + cerrdefs "github.com/containerd/errdefs" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/errdefs" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "gotest.tools/v3/assert" @@ -24,7 +24,7 @@ func TestServiceCreateError(t *testing.T) { client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")), } _, err := client.ServiceCreate(context.Background(), swarm.ServiceSpec{}, swarm.ServiceCreateOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) } // TestServiceCreateConnectionError verifies that connection errors occurring diff --git a/client/service_inspect_test.go b/client/service_inspect_test.go index 1bf334c48d..3ccd91b93a 100644 --- a/client/service_inspect_test.go +++ b/client/service_inspect_test.go @@ -11,8 +11,8 @@ import ( "strings" "testing" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -23,7 +23,7 @@ func TestServiceInspectError(t *testing.T) { } _, _, err := client.ServiceInspectWithRaw(context.Background(), "nothing", swarm.ServiceInspectOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) } func TestServiceInspectServiceNotFound(t *testing.T) { @@ -32,7 +32,7 @@ func TestServiceInspectServiceNotFound(t *testing.T) { } _, _, err := client.ServiceInspectWithRaw(context.Background(), "unknown", swarm.ServiceInspectOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsNotFound)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) } func TestServiceInspectWithEmptyID(t *testing.T) { @@ -42,11 +42,11 @@ func TestServiceInspectWithEmptyID(t *testing.T) { }), } _, _, err := client.ServiceInspectWithRaw(context.Background(), "", swarm.ServiceInspectOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) _, _, err = client.ServiceInspectWithRaw(context.Background(), " ", swarm.ServiceInspectOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) } diff --git a/client/service_list_test.go b/client/service_list_test.go index 51864b787f..2f9b54cbbf 100644 --- a/client/service_list_test.go +++ b/client/service_list_test.go @@ -10,9 +10,9 @@ import ( "strings" "testing" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -23,7 +23,7 @@ func TestServiceListError(t *testing.T) { } _, err := client.ServiceList(context.Background(), swarm.ServiceListOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) } func TestServiceList(t *testing.T) { diff --git a/client/service_logs_test.go b/client/service_logs_test.go index 917ebf602f..ec2f91dcfa 100644 --- a/client/service_logs_test.go +++ b/client/service_logs_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/container" - "github.com/docker/docker/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -23,7 +23,7 @@ func TestServiceLogsError(t *testing.T) { client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")), } _, err := client.ServiceLogs(context.Background(), "service_id", container.LogsOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) _, err = client.ServiceLogs(context.Background(), "service_id", container.LogsOptions{ Since: "2006-01-02TZ", @@ -31,11 +31,11 @@ func TestServiceLogsError(t *testing.T) { assert.Check(t, is.ErrorContains(err, `parsing time "2006-01-02TZ"`)) _, err = client.ServiceLogs(context.Background(), "", container.LogsOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) _, err = client.ServiceLogs(context.Background(), " ", container.LogsOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) } diff --git a/client/service_remove_test.go b/client/service_remove_test.go index 4942ee5f8e..5fef0645b7 100644 --- a/client/service_remove_test.go +++ b/client/service_remove_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - "github.com/docker/docker/errdefs" + cerrdefs "github.com/containerd/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -20,14 +20,14 @@ func TestServiceRemoveError(t *testing.T) { } err := client.ServiceRemove(context.Background(), "service_id") - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) err = client.ServiceRemove(context.Background(), "") - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) err = client.ServiceRemove(context.Background(), " ") - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) } @@ -38,7 +38,7 @@ func TestServiceRemoveNotFoundError(t *testing.T) { err := client.ServiceRemove(context.Background(), "service_id") assert.Check(t, is.ErrorContains(err, "no such service: service_id")) - assert.Check(t, is.ErrorType(err, errdefs.IsNotFound)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) } func TestServiceRemove(t *testing.T) { diff --git a/client/service_update_test.go b/client/service_update_test.go index 43b03b6660..2b34bbee45 100644 --- a/client/service_update_test.go +++ b/client/service_update_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" + cerrdefs "github.com/containerd/errdefs" "github.com/docker/docker/api/types/swarm" - "github.com/docker/docker/errdefs" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -21,14 +21,14 @@ func TestServiceUpdateError(t *testing.T) { } _, err := client.ServiceUpdate(context.Background(), "service_id", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsSystem)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) _, err = client.ServiceUpdate(context.Background(), "", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) _, err = client.ServiceUpdate(context.Background(), " ", swarm.Version{}, swarm.ServiceSpec{}, swarm.ServiceUpdateOptions{}) - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidParameter)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, "value is empty")) }