mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +08:00
Attempt manual removal of CNI IP allocations on refresh
We previously attempted to work within CNI to do this, without success. So let's do it manually, instead. We know where the files should live, so we can remove them ourselves instead. This solves issues around sudden reboots where containers do not have time to fully tear themselves down, and leave IP address allocations which, for various reasons, are not stored in tmpfs and persist through reboot. Fixes #5433 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -1436,13 +1436,6 @@ func (c *Container) copyOwnerAndPerms(source, dest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Teardown CNI config on refresh
|
||||
func (c *Container) refreshCNI() error {
|
||||
// Let's try and delete any lingering network config...
|
||||
podNetwork := c.runtime.getPodNetwork(c.ID(), c.config.Name, "", c.config.Networks, c.config.PortMappings, c.config.StaticIP, c.config.StaticMAC)
|
||||
return c.runtime.netPlugin.TearDownPod(podNetwork)
|
||||
}
|
||||
|
||||
// Get cgroup path in a format suitable for the OCI spec
|
||||
func (c *Container) getOCICgroupPath() (string, error) {
|
||||
unified, err := cgroups.IsCgroup2UnifiedMode()
|
||||
|
Reference in New Issue
Block a user