From eebf6824fc22a399fdf4b513d6530d9424f8902a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 May 2025 20:12:54 +0200 Subject: [PATCH] cli/command/plugin: remove errdefs uses Signed-off-by: Sebastiaan van Stijn --- cli/command/plugin/upgrade.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/command/plugin/upgrade.go b/cli/command/plugin/upgrade.go index 494cbdc6a0..da9ea4076d 100644 --- a/cli/command/plugin/upgrade.go +++ b/cli/command/plugin/upgrade.go @@ -10,7 +10,6 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/internal/jsonstream" "github.com/docker/cli/internal/prompt" - "github.com/docker/docker/errdefs" "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -70,7 +69,7 @@ func runUpgrade(ctx context.Context, dockerCLI command.Cli, opts pluginOptions) return err } if !r { - return errdefs.Cancelled(errors.New("plugin upgrade has been cancelled")) + return cancelledErr{errors.New("plugin upgrade has been cancelled")} } } @@ -93,3 +92,7 @@ func runUpgrade(ctx context.Context, dockerCLI command.Cli, opts pluginOptions) _, _ = fmt.Fprintf(dockerCLI.Out(), "Upgraded plugin %s to %s\n", opts.localName, opts.remote) // todo: return proper values from the API for this result return nil } + +type cancelledErr struct{ error } + +func (cancelledErr) Cancelled() {}