summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-06-07 14:25:18 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-06-07 14:35:07 +0200
commit811cce5a8a6fa1d95015ba0c3f6d4f68725fd753 (patch)
tree78f8f81553fcb016417688f428a98e10c12b53a6 /libpod/container_internal.go
parent1ada01a038fceaa9e94beb2de6e4593df03be7fa (diff)
downloadpodman-811cce5a8a6fa1d95015ba0c3f6d4f68725fd753.tar.gz
podman-811cce5a8a6fa1d95015ba0c3f6d4f68725fd753.tar.bz2
podman-811cce5a8a6fa1d95015ba0c3f6d4f68725fd753.zip
libpod: store network status when userns is used
When a container with a userns is created the network setup is special. Normally the netns is setup before the oci runtime container is created, however with a userns the container is created first and then the network is setup. In the second case we never saved the container state afterwards. Because of it, podman inspect would not show the network info and network teardown will not happen. This worked with local podman because there was a save() call later in the code path which then also saved the network status. But in the podman API code path this save never happened thus all containers started via API had this problem. Fixes #14465 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 7494eb3ec..5db65ca3f 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() {