aboutsummaryrefslogtreecommitdiff
path: root/libpod/runtime_pod.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-30 14:43:39 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-10-04 07:07:56 -0400
commit21c9dc3c406bb486c44c4a27e5b0497bab1cd40d (patch)
tree56793ffd885f835fa54013e9914844ff9ba20d92 /libpod/runtime_pod.go
parent36821d302e3787a42d6eefdbd0bdbb6d9da261fb (diff)
downloadpodman-21c9dc3c406bb486c44c4a27e5b0497bab1cd40d.tar.gz
podman-21c9dc3c406bb486c44c4a27e5b0497bab1cd40d.tar.bz2
podman-21c9dc3c406bb486c44c4a27e5b0497bab1cd40d.zip
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>
Diffstat (limited to 'libpod/runtime_pod.go')
-rw-r--r--libpod/runtime_pod.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/runtime_pod.go b/libpod/runtime_pod.go
index b142472e8..2389ee6d9 100644
--- a/libpod/runtime_pod.go
+++ b/libpod/runtime_pod.go
@@ -26,7 +26,7 @@ type PodFilter func(*Pod) bool
// If force is specified with removeCtrs, all containers will be stopped before
// being removed
// Otherwise, the pod will not be removed if any containers are running
-func (r *Runtime) RemovePod(ctx context.Context, p *Pod, removeCtrs, force bool) error {
+func (r *Runtime) RemovePod(ctx context.Context, p *Pod, removeCtrs, force bool, timeout *uint) error {
r.lock.Lock()
defer r.lock.Unlock()
@@ -45,7 +45,7 @@ func (r *Runtime) RemovePod(ctx context.Context, p *Pod, removeCtrs, force bool)
p.lock.Lock()
defer p.lock.Unlock()
- return r.removePod(ctx, p, removeCtrs, force)
+ return r.removePod(ctx, p, removeCtrs, force, timeout)
}
// GetPod retrieves a pod by its ID
@@ -196,7 +196,8 @@ func (r *Runtime) PrunePods(ctx context.Context) (map[string]error, error) {
return response, nil
}
for _, pod := range pods {
- err := r.removePod(context.TODO(), pod, true, false)
+ var timeout *uint
+ err := r.removePod(context.TODO(), pod, true, false, timeout)
response[pod.ID()] = err
}
return response, nil