summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-06-12 05:02:43 -0400
committerGitHub <noreply@github.com>2021-06-12 05:02:43 -0400
commitd1cb5d14e94534d5065e20178b6bd435097920e9 (patch)
treede670c55d7808e836c446432a10e25a21aa70b48
parent45dc3d699d20b2b1121a266cb7fda1c82a89ed35 (diff)
parent44d9c453d36f18eee93b1dbaf3158f0215521301 (diff)
downloadpodman-d1cb5d14e94534d5065e20178b6bd435097920e9.tar.gz
podman-d1cb5d14e94534d5065e20178b6bd435097920e9.tar.bz2
podman-d1cb5d14e94534d5065e20178b6bd435097920e9.zip
Merge pull request #10654 from Luap99/net-connect
Fix network connect race with docker-compose
-rw-r--r--libpod/networking_linux.go4
-rwxr-xr-xtest/compose/test-compose2
2 files changed, 4 insertions, 2 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index c928e02a6..5446841f6 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -1090,7 +1090,7 @@ func (c *Container) NetworkDisconnect(nameOrID, netName string, force bool) erro
}
c.newNetworkEvent(events.NetworkDisconnect, netName)
- if c.state.State != define.ContainerStateRunning {
+ if !c.ensureState(define.ContainerStateRunning, define.ContainerStateCreated) {
return nil
}
@@ -1145,7 +1145,7 @@ func (c *Container) NetworkConnect(nameOrID, netName string, aliases []string) e
return err
}
c.newNetworkEvent(events.NetworkConnect, netName)
- if c.state.State != define.ContainerStateRunning {
+ if !c.ensureState(define.ContainerStateRunning, define.ContainerStateCreated) {
return nil
}
if c.state.NetNS == nil {
diff --git a/test/compose/test-compose b/test/compose/test-compose
index 981f78a79..70db6dd55 100755
--- a/test/compose/test-compose
+++ b/test/compose/test-compose
@@ -183,6 +183,8 @@ function test_port() {
fi
echo "# cat $WORKDIR/server.log:"
cat $WORKDIR/server.log
+ echo "# cat $logfile:"
+ cat $logfile
return
fi