diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 5c6719bdf3..4e10b20bd4 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1000,6 +1000,9 @@ func (c *Container) completeNetworkSetup() error { if err := c.runtime.setupNetNS(c); err != nil { return err } + if err := c.save(); err != nil { + return err + } state := c.state // collect any dns servers that cni tells us to use (dnsname) for _, status := range c.getNetworkStatus() { diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index 3db0804d10..92aabae32d 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -111,6 +111,10 @@ load helpers $IMAGE nc -l -n -v -p $myport cid="$output" + # check that podman stores the network info correctly when a userns is used (#14465) + run_podman container inspect --format "{{.NetworkSettings.SandboxKey}}" $cid + assert "$output" =~ ".*/netns/netns-.*" "Netns path should be set" + wait_for_output "listening on .*:$myport .*" $cid # emit random string, and check it