From db19224b6dc35ac59062013256c73364eb024a99 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 23 Feb 2021 15:16:15 +0100 Subject: Only use rootless RLK when the container has ports Do not invoke the rootlesskit port forwarder when the container has no ports. Signed-off-by: Paul Holzinger --- libpod/networking_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index a5056d834..d927b17d8 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -436,7 +436,7 @@ func (r *Runtime) setupRootlessNetNS(ctr *Container) error { if err != nil { return err } - if len(networks) > 0 { + if len(networks) > 0 && len(ctr.config.PortMappings) > 0 { // set up port forwarder for CNI-in-slirp4netns netnsPath := ctr.state.NetNS.Path() // TODO: support slirp4netns port forwarder as well -- cgit v1.2.3-54-g00ecf