mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
commit
6c3d383b50
|
@ -40,7 +40,7 @@ func init() {
|
|||
pruneContainersCommand.SetHelpTemplate(HelpTemplate())
|
||||
pruneContainersCommand.SetUsageTemplate(UsageTemplate())
|
||||
flags := pruneContainersCommand.Flags()
|
||||
flags.BoolVarP(&pruneContainersCommand.Force, "force", "f", false, "Force removal of a running container. The default is false")
|
||||
flags.BoolVarP(&pruneContainersCommand.Force, "force", "f", false, "Skip interactive prompt for container removal")
|
||||
flags.StringArrayVar(&pruneContainersCommand.Filter, "filter", []string{}, "Provide filter values (e.g. 'until=<timestamp>')")
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ Are you sure you want to continue? [y/N] `)
|
|||
if c.GlobalIsSet("max-workers") {
|
||||
maxWorkers = c.GlobalFlags.MaxWorks
|
||||
}
|
||||
ok, failures, err := runtime.Prune(getContext(), maxWorkers, c.Force, c.Filter)
|
||||
ok, failures, err := runtime.Prune(getContext(), maxWorkers, c.Filter)
|
||||
if err != nil {
|
||||
if errors.Cause(err) == define.ErrNoSuchCtr {
|
||||
if len(c.InputArgs) > 1 {
|
||||
|
|
|
@ -92,7 +92,7 @@ Are you sure you want to continue? [y/N] `, volumeString)
|
|||
|
||||
rmWorkers := shared.Parallelize("rm")
|
||||
fmt.Println("Deleted Containers")
|
||||
ok, failures, err = runtime.Prune(ctx, rmWorkers, false, []string{})
|
||||
ok, failures, err = runtime.Prune(ctx, rmWorkers, []string{})
|
||||
if err != nil {
|
||||
if lasterr != nil {
|
||||
logrus.Errorf("%q", err)
|
||||
|
|
|
@ -11,6 +11,9 @@ podman-container-prune - Remove all stopped containers from local storage
|
|||
|
||||
## OPTIONS
|
||||
|
||||
**--force**, **-f**
|
||||
Do not provide an interactive prompt for container removal.
|
||||
|
||||
**-h**, **--help**
|
||||
|
||||
Print usage statement
|
||||
|
|
|
@ -1050,7 +1050,7 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
|
|||
}
|
||||
|
||||
// Prune removes stopped containers
|
||||
func (r *LocalRuntime) Prune(ctx context.Context, maxWorkers int, force bool, filters []string) ([]string, map[string]error, error) {
|
||||
func (r *LocalRuntime) Prune(ctx context.Context, maxWorkers int, filters []string) ([]string, map[string]error, error) {
|
||||
var (
|
||||
ok = []string{}
|
||||
failures = map[string]error{}
|
||||
|
@ -1102,7 +1102,7 @@ func (r *LocalRuntime) Prune(ctx context.Context, maxWorkers int, force bool, fi
|
|||
pool.Add(shared.Job{
|
||||
ID: ctr.ID(),
|
||||
Fn: func() error {
|
||||
err := r.Runtime.RemoveContainer(ctx, ctr, force, false)
|
||||
err := r.Runtime.RemoveContainer(ctx, ctr, false, false)
|
||||
if err != nil {
|
||||
logrus.Debugf("Failed to prune container %s: %s", ctr.ID(), err.Error())
|
||||
}
|
||||
|
|
|
@ -922,7 +922,7 @@ func (r *LocalRuntime) Top(cli *cliconfig.TopValues) ([]string, error) {
|
|||
}
|
||||
|
||||
// Prune removes stopped containers
|
||||
func (r *LocalRuntime) Prune(ctx context.Context, maxWorkers int, force bool, filter []string) ([]string, map[string]error, error) {
|
||||
func (r *LocalRuntime) Prune(ctx context.Context, maxWorkers int, filter []string) ([]string, map[string]error, error) {
|
||||
|
||||
var (
|
||||
ok = []string{}
|
||||
|
|
Loading…
Reference in a new issue