In the docker source repo, there exists an interface in image/backend.go:
type imageBackend interface {
....
ImagesPrune(pruneFilters filters.Args) (*types.ImagesPruneReport, error)
}
and, there is an implementation in daemon/prune.go:
func (daemon *Daemon) ImagesPrune(pruneFilters filters.Args) (*types.ImagesPruneReport, error) {
... implementation details ...
}
Does this mean it's correct to say that Daemon
implements the imageBackend
interface?
Background:
I'm trying to understand how calling docker system prune
cmd invokes the ImagesPrune
function in daemon.go
. I could trace the code flow as:
cli/../system/prune.go -> cli/../prune/prune.go -> cli/../image/prune.go -> client/image_prune.go -> api/server/..image/image_routes.go -> api/server/../image/backend.go -----> ??? ----> daemon/prune.go
I don't know what comes in the ???
section above.