diff --git a/client/container_exec.go b/client/container_exec.go index 1af6a4e20f..953836423a 100644 --- a/client/container_exec.go +++ b/client/container_exec.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/container" ) @@ -152,7 +152,7 @@ func (cli *Client) ExecAttach(ctx context.Context, execID string, options ExecAt func getConsoleSize(hasTTY bool, consoleSize ConsoleSize) (*[2]uint, error) { if consoleSize.Height != 0 || consoleSize.Width != 0 { if !hasTTY { - return nil, errdefs.ErrInvalidArgument.WithMessage("console size is only supported when TTY is enabled") + return nil, cerrdefs.ErrInvalidArgument.WithMessage("console size is only supported when TTY is enabled") } return &[2]uint{consoleSize.Height, consoleSize.Width}, nil } diff --git a/client/container_exec_test.go b/client/container_exec_test.go index 27e0672a5c..673e235b83 100644 --- a/client/container_exec_test.go +++ b/client/container_exec_test.go @@ -6,7 +6,6 @@ import ( "net/http" "testing" - "github.com/containerd/errdefs" cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/container" "gotest.tools/v3/assert" @@ -163,7 +162,7 @@ func TestExecStartConsoleSize(t *testing.T) { _, err = client.ExecStart(t.Context(), "exec_id", tc.options) if tc.expErr != "" { - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidArgument)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.ErrorContains(err, tc.expErr)) assert.Check(t, is.DeepEqual(actualReq, tc.expReq)) } else { diff --git a/client/container_rename.go b/client/container_rename.go index 7c6d515b39..4fd28a4986 100644 --- a/client/container_rename.go +++ b/client/container_rename.go @@ -5,7 +5,7 @@ import ( "net/url" "strings" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" ) // ContainerRenameOptions represents the options for renaming a container. @@ -28,7 +28,7 @@ func (cli *Client) ContainerRename(ctx context.Context, containerID string, opti if options.NewName == "" || strings.TrimPrefix(options.NewName, "/") == "" { // daemons before v29.0 did not handle the canonical name ("/") well // let's be nice and validate it here before sending - return ContainerRenameResult{}, errdefs.ErrInvalidArgument.WithMessage("new name cannot be blank") + return ContainerRenameResult{}, cerrdefs.ErrInvalidArgument.WithMessage("new name cannot be blank") } query := url.Values{} diff --git a/client/pkg/security/security_opts_test.go b/client/pkg/security/security_opts_test.go index e7eed9736a..714689eed9 100644 --- a/client/pkg/security/security_opts_test.go +++ b/client/pkg/security/security_opts_test.go @@ -5,7 +5,7 @@ import ( "testing" "gotest.tools/v3/assert" - "gotest.tools/v3/assert/cmp" + is "gotest.tools/v3/assert/cmp" ) func TestDecode(t *testing.T) { @@ -161,7 +161,7 @@ func TestDecode(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { got := DecodeOptions(tc.opts) - assert.Check(t, cmp.DeepEqual(got, tc.want)) + assert.Check(t, is.DeepEqual(got, tc.want)) }) } } diff --git a/client/volume_prune.go b/client/volume_prune.go index 561e328d73..eec0f482ba 100644 --- a/client/volume_prune.go +++ b/client/volume_prune.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/volume" ) @@ -29,7 +29,7 @@ type VolumePruneResult struct { func (cli *Client) VolumePrune(ctx context.Context, options VolumePruneOptions) (VolumePruneResult, error) { if options.All { if _, ok := options.Filters["all"]; ok { - return VolumePruneResult{}, errdefs.ErrInvalidArgument.WithMessage(`conflicting options: cannot specify both "all" and "all" filter`) + return VolumePruneResult{}, cerrdefs.ErrInvalidArgument.WithMessage(`conflicting options: cannot specify both "all" and "all" filter`) } if options.Filters == nil { options.Filters = Filters{} diff --git a/client/volume_prune_test.go b/client/volume_prune_test.go index 956a7109f3..76e2fa312d 100644 --- a/client/volume_prune_test.go +++ b/client/volume_prune_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/volume" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -81,7 +81,7 @@ func TestVolumePrune(t *testing.T) { _, err = client.VolumePrune(t.Context(), tc.opts) if tc.expectedError != "" { - assert.Check(t, is.ErrorType(err, errdefs.IsInvalidArgument)) + assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument)) assert.Check(t, is.Error(err, tc.expectedError)) } else { assert.NilError(t, err) diff --git a/vendor/github.com/moby/moby/client/container_exec.go b/vendor/github.com/moby/moby/client/container_exec.go index 1af6a4e20f..953836423a 100644 --- a/vendor/github.com/moby/moby/client/container_exec.go +++ b/vendor/github.com/moby/moby/client/container_exec.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/container" ) @@ -152,7 +152,7 @@ func (cli *Client) ExecAttach(ctx context.Context, execID string, options ExecAt func getConsoleSize(hasTTY bool, consoleSize ConsoleSize) (*[2]uint, error) { if consoleSize.Height != 0 || consoleSize.Width != 0 { if !hasTTY { - return nil, errdefs.ErrInvalidArgument.WithMessage("console size is only supported when TTY is enabled") + return nil, cerrdefs.ErrInvalidArgument.WithMessage("console size is only supported when TTY is enabled") } return &[2]uint{consoleSize.Height, consoleSize.Width}, nil } diff --git a/vendor/github.com/moby/moby/client/container_rename.go b/vendor/github.com/moby/moby/client/container_rename.go index 7c6d515b39..4fd28a4986 100644 --- a/vendor/github.com/moby/moby/client/container_rename.go +++ b/vendor/github.com/moby/moby/client/container_rename.go @@ -5,7 +5,7 @@ import ( "net/url" "strings" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" ) // ContainerRenameOptions represents the options for renaming a container. @@ -28,7 +28,7 @@ func (cli *Client) ContainerRename(ctx context.Context, containerID string, opti if options.NewName == "" || strings.TrimPrefix(options.NewName, "/") == "" { // daemons before v29.0 did not handle the canonical name ("/") well // let's be nice and validate it here before sending - return ContainerRenameResult{}, errdefs.ErrInvalidArgument.WithMessage("new name cannot be blank") + return ContainerRenameResult{}, cerrdefs.ErrInvalidArgument.WithMessage("new name cannot be blank") } query := url.Values{} diff --git a/vendor/github.com/moby/moby/client/volume_prune.go b/vendor/github.com/moby/moby/client/volume_prune.go index 561e328d73..eec0f482ba 100644 --- a/vendor/github.com/moby/moby/client/volume_prune.go +++ b/vendor/github.com/moby/moby/client/volume_prune.go @@ -6,7 +6,7 @@ import ( "fmt" "net/url" - "github.com/containerd/errdefs" + cerrdefs "github.com/containerd/errdefs" "github.com/moby/moby/api/types/volume" ) @@ -29,7 +29,7 @@ type VolumePruneResult struct { func (cli *Client) VolumePrune(ctx context.Context, options VolumePruneOptions) (VolumePruneResult, error) { if options.All { if _, ok := options.Filters["all"]; ok { - return VolumePruneResult{}, errdefs.ErrInvalidArgument.WithMessage(`conflicting options: cannot specify both "all" and "all" filter`) + return VolumePruneResult{}, cerrdefs.ErrInvalidArgument.WithMessage(`conflicting options: cannot specify both "all" and "all" filter`) } if options.Filters == nil { options.Filters = Filters{}