Merge pull request #14507 from Luap99/userns-net

libpod: store network status when userns is used
This commit is contained in:
OpenShift Merge Robot 2022-06-07 11:00:28 -04:00 • committed by GitHub
commit 96f9d0dc0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -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() {

View file

@ -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