summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-05-11 18:41:36 +0200
committerPaul Holzinger <paul.holzinger@web.de>2021-05-11 22:37:32 +0200
commit30544f225e73a4180f4afb0d062006c9fa61a309 (patch)
treef135ce04d90289283e170aa140b4cce48ed0ac05 /libpod
parent8dcd5b893feb8b3b34386e6688d20b7ef098228b (diff)
downloadpodman-30544f225e73a4180f4afb0d062006c9fa61a309.tar.gz
podman-30544f225e73a4180f4afb0d062006c9fa61a309.tar.bz2
podman-30544f225e73a4180f4afb0d062006c9fa61a309.zip
fix restart always with slirp4netns
When a container is automatically restarted due its restart policy and the container used the slirp4netns netmode, the slirp4netns process died. This caused the container to lose network connectivity. To fix this we have to start a new slirp4netns process. Fixes #8047 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 051fe4b9e..53b85a466 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -283,6 +283,14 @@ func (c *Container) handleRestartPolicy(ctx context.Context) (_ bool, retErr err
return false, err
}
+ // setup slirp4netns again because slirp4netns will die when conmon exits
+ if c.config.NetMode.IsSlirp4netns() {
+ err := c.runtime.setupSlirp4netns(c)
+ if err != nil {
+ return false, err
+ }
+ }
+
if c.state.State == define.ContainerStateStopped {
// Reinitialize the container if we need to
if err := c.reinit(ctx, true); err != nil {