cli/command/plugin: remove errdefs uses

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-05-16 20:12:54 +02:00
parent 214d2bfb6b
commit eebf6824fc
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -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() {}