pruneFn calls the Container Prune API for use in "docker system prune", and returns the amount of space reclaimed and a detailed output string.
(ctx context.Context, dockerCLI command.Cli, options pruner.PruneOptions)
| 101 | // pruneFn calls the Container Prune API for use in "docker system prune", |
| 102 | // and returns the amount of space reclaimed and a detailed output string. |
| 103 | func pruneFn(ctx context.Context, dockerCLI command.Cli, options pruner.PruneOptions) (uint64, string, error) { |
| 104 | if !options.Confirmed { |
| 105 | // Dry-run: perform validation and produce confirmation before pruning. |
| 106 | confirmMsg := "all stopped containers" |
| 107 | return 0, confirmMsg, cancelledErr{errors.New("containers prune has been cancelled")} |
| 108 | } |
| 109 | return runPrune(ctx, dockerCLI, pruneOptions{ |
| 110 | force: true, |
| 111 | filter: options.Filter, |
| 112 | }) |
| 113 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…