From ad7e6a02d791a75e841440a9ab1ef6126ab0ca8a Mon Sep 17 00:00:00 2001 From: Tyler Ramer Date: Thu, 14 Nov 2019 22:33:36 -0500 Subject: [PATCH] Add --force flag to images prune Add a -f, --force flag to images prune. As there was previously no prompt to force prune images, this commit does nothing to add such a question, only make the cli command compatible with docker cli. Resolves #4410 Signed-off-by: Tyler Ramer --- cmd/podman/cliconfig/config.go | 3 ++- cmd/podman/images_prune.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go index 780b683331..ff38064f75 100644 --- a/cmd/podman/cliconfig/config.go +++ b/cmd/podman/cliconfig/config.go @@ -175,7 +175,8 @@ type HistoryValues struct { } type PruneImagesValues struct { PodmanCommand - All bool + All bool + Force bool } type PruneContainersValues struct { diff --git a/cmd/podman/images_prune.go b/cmd/podman/images_prune.go index 5745edd6b7..e17728b209 100644 --- a/cmd/podman/images_prune.go +++ b/cmd/podman/images_prune.go @@ -34,6 +34,7 @@ func init() { pruneImagesCommand.SetUsageTemplate(UsageTemplate()) flags := pruneImagesCommand.Flags() flags.BoolVarP(&pruneImagesCommand.All, "all", "a", false, "Remove all unused images, not just dangling ones") + flags.BoolVarP(&pruneImagesCommand.Force, "force", "f", false, "Do not prompt for confirmation on pruning images") } func pruneImagesCmd(c *cliconfig.PruneImagesValues) error {