diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-05 00:59:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 00:59:07 -0800 |
commit | fb8c49479e33c01b0c97cf6286255c39415e6bc6 (patch) | |
tree | 032a2ff2369d803a6868b2668544f69b6c08453a /libpod | |
parent | 5092c078ec635c9f1598989b27ccf53369b3cf2b (diff) | |
parent | 6d487c781a7a046a72b3139319476948f855748e (diff) | |
download | podman-fb8c49479e33c01b0c97cf6286255c39415e6bc6.tar.gz podman-fb8c49479e33c01b0c97cf6286255c39415e6bc6.tar.bz2 podman-fb8c49479e33c01b0c97cf6286255c39415e6bc6.zip |
Merge pull request #5052 from mheon/cleanup_net_on_restart
Tear down network when restarting containers
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 0e883588c..78ec09f29 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1254,6 +1254,12 @@ func (c *Container) restartWithTimeout(ctx context.Context, timeout uint) (err e } } } + // Ensure we tear down the container network so it will be + // recreated - otherwise, behavior of restart differs from stop + // and start + if err := c.cleanupNetwork(); err != nil { + return err + } } defer func() { if err != nil { |