From 6708bc235feb09f5a5bc3f673da1e7c4beee5e12 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Thu, 14 Jan 2021 12:26:34 -0500 Subject: use AttachSocketPath when removing conmon files Signed-off-by: Peter Hunt --- libpod/container_internal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libpod') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index a53027ab2..041fa13e7 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -685,7 +685,11 @@ func (c *Container) removeIPv4Allocations() error { // This is necessary for restarting containers func (c *Container) removeConmonFiles() error { // Files are allowed to not exist, so ignore ENOENT - attachFile := filepath.Join(c.bundlePath(), "attach") + attachFile, err := c.AttachSocketPath() + if err != nil { + return errors.Wrapf(err, "failed to get attach socket path for container %s", c.ID()) + } + if err := os.Remove(attachFile); err != nil && !os.IsNotExist(err) { return errors.Wrapf(err, "error removing container %s attach file", c.ID()) } -- cgit v1.2.3-54-g00ecf