MCPcopy Create free account
hub / github.com/docker/cli / pruneFn

Function pruneFn

cli/command/network/prune.go:99–110  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
99func 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}

Callers

nothing calls this directly

Calls 1

runPruneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…