diff options
author | W. Trevor King <wking@tremily.us> | 2018-05-31 11:47:17 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-04 18:36:40 +0000 |
commit | c9f763456cd8263c3f2d84c6b2b6e17ad81cf3ba (patch) | |
tree | b1cffd82978145f372893f62754432d75003b31d /libpod/runtime_pod.go | |
parent | 28d1cec9f64cca11d42410c6e33c43b01b1d7678 (diff) | |
download | podman-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_pod.go')
-rw-r--r-- | libpod/runtime_pod.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/runtime_pod.go b/libpod/runtime_pod.go index 3872a4b67..067a110fa 100644 --- a/libpod/runtime_pod.go +++ b/libpod/runtime_pod.go @@ -1,6 +1,7 @@ package libpod import ( + "context" "path" "path/filepath" "strings" @@ -91,7 +92,7 @@ func (r *Runtime) NewPod(options ...PodCreateOption) (*Pod, error) { // 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(p *Pod, removeCtrs, force bool) error { +func (r *Runtime) RemovePod(ctx context.Context, p *Pod, removeCtrs, force bool) error { r.lock.Lock() defer r.lock.Unlock() @@ -206,11 +207,10 @@ func (r *Runtime) RemovePod(p *Pod, removeCtrs, force bool) error { // Delete the container from runtime (only if we are not // ContainerStateConfigured) if ctr.state.State != ContainerStateConfigured { - if err := r.ociRuntime.deleteContainer(ctr); err != nil { - return errors.Wrapf(err, "error removing container %s from runtime", ctr.ID()) + if err := ctr.delete(ctx); err != nil { + return err } } - } // Remove containers from the state |