mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +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:
@ -657,6 +657,13 @@ func resultToBasicNetworkConfig(result *cnitypes.Result) (InspectBasicNetworkCon
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// This is a horrible hack, necessary because CNI does not properly clean up
|
||||
// after itself on an unclean reboot. Return what we're pretty sure is the path
|
||||
// to CNI's internal files (it's not really exposed to us).
|
||||
func getCNINetworksDir() (string, error) {
|
||||
return "/var/lib/cni/networks", nil
|
||||
}
|
||||
|
||||
type logrusDebugWriter struct {
|
||||
prefix string
|
||||
}
|
||||
|
Reference in New Issue
Block a user