Skip to content

Commit

Permalink
Merge pull request #5052 from mheon/cleanup_net_on_restart
Browse files Browse the repository at this point in the history
Tear down network when restarting containers
  • Loading branch information
openshift-merge-robot authored Feb 5, 2020
2 parents 5092c07 + 6d487c7 commit fb8c494
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fb8c494

Please sign in to comment.