Add --filter until=<timestamp> for docker container/image prune
This fix is a follow up for comment https://github.com/docker/docker/pull/28535#issuecomment-263215225 This fix provides `--filter until=<timestamp>` for `docker container/image prune`. This fix adds `--filter until=<timestamp>` to `docker container/image prune` so that it is possible to specify a timestamp and prune those containers/images that are earlier than the timestamp. Related docs has been updated Several integration tests have been added to cover changes. This fix fixes #28497. This fix is related to #28535. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"github.com/docker/docker/cli/command/image"
|
||||
"github.com/docker/docker/cli/command/network"
|
||||
"github.com/docker/docker/cli/command/volume"
|
||||
"github.com/docker/docker/opts"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@ -30,21 +31,21 @@ func NewNetworkPruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||
}
|
||||
|
||||
// RunContainerPrune executes a prune command for containers
|
||||
func RunContainerPrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
||||
return container.RunPrune(dockerCli)
|
||||
func RunContainerPrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
||||
return container.RunPrune(dockerCli, filter)
|
||||
}
|
||||
|
||||
// RunVolumePrune executes a prune command for volumes
|
||||
func RunVolumePrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
||||
func RunVolumePrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
||||
return volume.RunPrune(dockerCli)
|
||||
}
|
||||
|
||||
// RunImagePrune executes a prune command for images
|
||||
func RunImagePrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) {
|
||||
return image.RunPrune(dockerCli, all)
|
||||
func RunImagePrune(dockerCli *command.DockerCli, all bool, filter opts.FilterOpt) (uint64, string, error) {
|
||||
return image.RunPrune(dockerCli, all, filter)
|
||||
}
|
||||
|
||||
// RunNetworkPrune executes a prune command for networks
|
||||
func RunNetworkPrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
||||
return network.RunPrune(dockerCli)
|
||||
func RunNetworkPrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
||||
return network.RunPrune(dockerCli, filter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user