Ability to prune container in api V2

Adds ability to prune containers for v2.
Adds client side prompt with force flag and filters options to prune.

Signed-off-by: Sujil02 <sushah@redhat.com>
This commit is contained in:
Sujil02
2020-04-08 04:49:32 -04:00
parent 37ed662f32
commit ec4060aef6
10 changed files with 201 additions and 18 deletions

View File

@ -887,8 +887,9 @@ func (r *Runtime) PruneContainers(filterFuncs []ContainerFilter) (map[string]int
continue
}
err = r.RemoveContainer(context.Background(), ctr, false, false)
pruneErrors[ctr.ID()] = err
if err != nil {
pruneErrors[ctr.ID()] = err
} else {
prunedContainers[ctr.ID()] = size
}
}