Skip to content

Commit c400946

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

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cli/command/builder/prune.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import (
1212
"github.com/docker/cli/internal/prompt"
1313
"github.com/docker/cli/opts"
1414
"github.com/docker/docker/api/types/build"
15-
"github.com/docker/docker/errdefs"
16-
units "github.com/docker/go-units"
15+
"github.com/docker/go-units"
1716
"github.com/spf13/cobra"
1817
)
1918

@@ -75,7 +74,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
7574
return 0, "", err
7675
}
7776
if !r {
78-
return 0, "", errdefs.Cancelled(errors.New("builder prune has been cancelled"))
77+
return 0, "", cancelledErr{errors.New("builder prune has been cancelled")}
7978
}
8079
}
8180

@@ -101,6 +100,10 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
101100
return report.SpaceReclaimed, output, nil
102101
}
103102

103+
type cancelledErr struct{ error }
104+
105+
func (cancelledErr) Cancelled() {}
106+
104107
// CachePrune executes a prune command for build cache
105108
func CachePrune(ctx context.Context, dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {
106109
return runPrune(ctx, dockerCli, pruneOptions{force: true, all: all, filter: filter})

0 commit comments

Comments
 (0)