cli/command/system: remove errdefs uses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
251725676e
commit
3d68a39015
@ -18,7 +18,6 @@ import (
|
||||
"github.com/docker/cli/internal/prompt"
|
||||
"github.com/docker/cli/opts"
|
||||
"github.com/docker/docker/api/types/versions"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/go-units"
|
||||
"github.com/fvbommel/sortorder"
|
||||
"github.com/pkg/errors"
|
||||
@ -83,7 +82,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
|
||||
return err
|
||||
}
|
||||
if !r {
|
||||
return errdefs.Cancelled(errors.New("system prune has been cancelled"))
|
||||
return cancelledErr{errors.New("system prune has been cancelled")}
|
||||
}
|
||||
}
|
||||
pruneFuncs := []func(ctx context.Context, dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error){
|
||||
@ -115,6 +114,10 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
|
||||
return nil
|
||||
}
|
||||
|
||||
type cancelledErr struct{ error }
|
||||
|
||||
func (cancelledErr) Cancelled() {}
|
||||
|
||||
// confirmationMessage constructs a confirmation message that depends on the cli options.
|
||||
func confirmationMessage(dockerCli command.Cli, options pruneOptions) string {
|
||||
t := template.Must(template.New("confirmation message").Parse(confirmationTemplate))
|
||||
|
Loading…
x
Reference in New Issue
Block a user