Skip to content

Commit 214d2bf

Browse files
committed
cli/command/image: remove errdefs uses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent c400946 commit 214d2bf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cli/command/image/prune.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import (
1111
"github.com/docker/cli/cli/command/completion"
1212
"github.com/docker/cli/internal/prompt"
1313
"github.com/docker/cli/opts"
14-
"github.com/docker/docker/errdefs"
15-
units "github.com/docker/go-units"
14+
"github.com/docker/go-units"
1615
"github.com/pkg/errors"
1716
"github.com/spf13/cobra"
1817
)
@@ -76,7 +75,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
7675
return 0, "", err
7776
}
7877
if !r {
79-
return 0, "", errdefs.Cancelled(errors.New("image prune has been cancelled"))
78+
return 0, "", cancelledErr{errors.New("image prune has been cancelled")}
8079
}
8180
}
8281

@@ -106,6 +105,10 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
106105
return spaceReclaimed, output, nil
107106
}
108107

108+
type cancelledErr struct{ error }
109+
110+
func (cancelledErr) Cancelled() {}
111+
109112
// RunPrune calls the Image Prune API
110113
// This returns the amount of space reclaimed and a detailed output string
111114
func RunPrune(ctx context.Context, dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {

0 commit comments

Comments
 (0)