mirror of
https://github.com/containers/podman.git
synced 2025-08-02 17:22:30 +08:00
Add --time out for podman * rm -f commands
Add --time flag to podman container rm Add --time flag to podman pod rm Add --time flag to podman volume rm Add --time flag to podman network rm Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -18,12 +18,13 @@ import (
|
||||
|
||||
// Reset removes all storage
|
||||
func (r *Runtime) Reset(ctx context.Context) error {
|
||||
var timeout *uint
|
||||
pods, err := r.GetAllPods()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, p := range pods {
|
||||
if err := r.RemovePod(ctx, p, true, true); err != nil {
|
||||
if err := r.RemovePod(ctx, p, true, true, timeout); err != nil {
|
||||
if errors.Cause(err) == define.ErrNoSuchPod {
|
||||
continue
|
||||
}
|
||||
@ -37,7 +38,7 @@ func (r *Runtime) Reset(ctx context.Context) error {
|
||||
}
|
||||
|
||||
for _, c := range ctrs {
|
||||
if err := r.RemoveContainer(ctx, c, true, true); err != nil {
|
||||
if err := r.RemoveContainer(ctx, c, true, true, timeout); err != nil {
|
||||
if err := r.RemoveStorageContainer(c.ID(), true); err != nil {
|
||||
if errors.Cause(err) == define.ErrNoSuchCtr {
|
||||
continue
|
||||
@ -61,7 +62,7 @@ func (r *Runtime) Reset(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
for _, v := range volumes {
|
||||
if err := r.RemoveVolume(ctx, v, true); err != nil {
|
||||
if err := r.RemoveVolume(ctx, v, true, timeout); err != nil {
|
||||
if errors.Cause(err) == define.ErrNoSuchVolume {
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user