Remove unnecessary prune function aliases.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-07-18 12:25:45 -04:00
parent 0f91d9e6c4
commit ff350a04cb
1 changed files with 4 additions and 24 deletions

View File

@ -57,26 +57,6 @@ const confirmationTemplate = `WARNING! This will remove:
{{- end }} {{- end }}
Are you sure you want to continue?` Are you sure you want to continue?`
// runContainerPrune executes a prune command for containers
func runContainerPrune(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) {
return container.RunPrune(dockerCli, filter)
}
// runNetworkPrune executes a prune command for networks
func runNetworkPrune(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) {
return network.RunPrune(dockerCli, filter)
}
// runVolumePrune executes a prune command for volumes
func runVolumePrune(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) {
return volume.RunPrune(dockerCli, filter)
}
// runImagePrune executes a prune command for images
func runImagePrune(dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error) {
return image.RunPrune(dockerCli, all, filter)
}
// runBuildCachePrune executes a prune command for build cache // runBuildCachePrune executes a prune command for build cache
func runBuildCachePrune(dockerCli command.Cli, _ opts.FilterOpt) (uint64, string, error) { func runBuildCachePrune(dockerCli command.Cli, _ opts.FilterOpt) (uint64, string, error) {
report, err := dockerCli.Client().BuildCachePrune(context.Background()) report, err := dockerCli.Client().BuildCachePrune(context.Background())
@ -94,14 +74,14 @@ func runPrune(dockerCli command.Cli, options pruneOptions) error {
return nil return nil
} }
imagePrune := func(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) { imagePrune := func(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error) {
return runImagePrune(dockerCli, options.all, options.filter) return image.RunPrune(dockerCli, options.all, options.filter)
} }
pruneFuncs := []func(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error){ pruneFuncs := []func(dockerCli command.Cli, filter opts.FilterOpt) (uint64, string, error){
runContainerPrune, container.RunPrune,
runNetworkPrune, network.RunPrune,
} }
if options.pruneVolumes { if options.pruneVolumes {
pruneFuncs = append(pruneFuncs, runVolumePrune) pruneFuncs = append(pruneFuncs, volume.RunPrune)
} }
pruneFuncs = append(pruneFuncs, imagePrune) pruneFuncs = append(pruneFuncs, imagePrune)
if options.pruneBuildCache { if options.pruneBuildCache {