pruneFn calls the Network 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)
| 97 | // pruneFn calls the Network Prune API for use in "docker system prune" |
| 98 | // and returns the amount of space reclaimed and a detailed output string. |
| 99 | func pruneFn(ctx context.Context, dockerCLI command.Cli, options pruner.PruneOptions) (uint64, string, error) { |
| 100 | if !options.Confirmed { |
| 101 | // Dry-run: perform validation and produce confirmation before pruning. |
| 102 | confirmMsg := "all networks not used by at least one container" |
| 103 | return 0, confirmMsg, cancelledErr{errors.New("network prune has been cancelled")} |
| 104 | } |
| 105 | output, err := runPrune(ctx, dockerCLI, pruneOptions{ |
| 106 | force: true, |
| 107 | filter: options.Filter, |
| 108 | }) |
| 109 | return 0, output, err |
| 110 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…