summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2018-05-31 11:47:17 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-04 18:36:40 +0000
commitc9f763456cd8263c3f2d84c6b2b6e17ad81cf3ba (patch)
treeb1cffd82978145f372893f62754432d75003b31d /libpod/runtime_img.go
parent28d1cec9f64cca11d42410c6e33c43b01b1d7678 (diff)
downloadpodman-c9f763456cd8263c3f2d84c6b2b6e17ad81cf3ba.tar.gz
podman-c9f763456cd8263c3f2d84c6b2b6e17ad81cf3ba.tar.bz2
podman-c9f763456cd8263c3f2d84c6b2b6e17ad81cf3ba.zip
libpod: Execute poststop hooks locally
Instead of delegating to the runtime, since some runtimes do not seem to handle these reliably [1]. [1]: https://github.com/projectatomic/libpod/issues/730#issuecomment-392959938 Signed-off-by: W. Trevor King <wking@tremily.us> Closes: #864 Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 2392c41d4..8b0c08cd3 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -75,7 +75,7 @@ type CopyOptions struct {
// RemoveImage deletes an image from local storage
// Images being used by running containers can only be removed if force=true
-func (r *Runtime) RemoveImage(image *image.Image, force bool) (string, error) {
+func (r *Runtime) RemoveImage(ctx context.Context, image *image.Image, force bool) (string, error) {
r.lock.Lock()
defer r.lock.Unlock()
@@ -97,7 +97,7 @@ func (r *Runtime) RemoveImage(image *image.Image, force bool) (string, error) {
if len(imageCtrs) > 0 && len(image.Names()) <= 1 {
if force {
for _, ctr := range imageCtrs {
- if err := r.removeContainer(ctr, true); err != nil {
+ if err := r.removeContainer(ctx, ctr, true); err != nil {
return "", errors.Wrapf(err, "error removing image %s: container %s using image could not be removed", image.ID(), ctr.ID())
}
}