summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorPeter Hunt <pehunt@redhat.com>2021-01-14 12:26:34 -0500
committerPeter Hunt <pehunt@redhat.com>2021-04-16 17:45:52 -0400
commit6708bc235feb09f5a5bc3f673da1e7c4beee5e12 (patch)
tree3ce92522b78da5b724bce3e705fe83bf69f93d43 /libpod/container_internal.go
parent35b62ef19f307fb365eb7a8734e456160f7b22a8 (diff)
downloadpodman-6708bc235feb09f5a5bc3f673da1e7c4beee5e12.tar.gz
podman-6708bc235feb09f5a5bc3f673da1e7c4beee5e12.tar.bz2
podman-6708bc235feb09f5a5bc3f673da1e7c4beee5e12.zip
use AttachSocketPath when removing conmon files
Signed-off-by: Peter Hunt <pehunt@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go6
1 files changed, 5 insertions, 1 deletions
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())
}