diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-12 05:02:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 05:02:43 -0400 |
commit | d1cb5d14e94534d5065e20178b6bd435097920e9 (patch) | |
tree | de670c55d7808e836c446432a10e25a21aa70b48 /libpod | |
parent | 45dc3d699d20b2b1121a266cb7fda1c82a89ed35 (diff) | |
parent | 44d9c453d36f18eee93b1dbaf3158f0215521301 (diff) | |
download | podman-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
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/networking_linux.go | 4 |
1 files changed, 2 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 { |