@@ -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
105108func 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