diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-03-09 16:06:43 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-03-19 17:20:31 -0400 |
commit | b6954758bb17f846f81fada71385a94b5072e91c (patch) | |
tree | 88a24857eafc25bccc7559869cc6ab9d896426d9 /libpod/networking_linux.go | |
parent | aa6c8c2e55a7de14fb22f89af14d5c0636eecee0 (diff) | |
download | podman-b6954758bb17f846f81fada71385a94b5072e91c.tar.gz podman-b6954758bb17f846f81fada71385a94b5072e91c.tar.bz2 podman-b6954758bb17f846f81fada71385a94b5072e91c.zip |
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>
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r-- | libpod/networking_linux.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 5a27a2abb..f1bf79ce7 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -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 } |