Flush weave ipsets before destroying
ipsets can't be destroyed when there are references to them. This takes the easy way out and flushes all weave ipsets first. Fixes #2915
This commit is contained in:
1 parent
95ee99d652
commit
8668f6bb1e
1 file changed
+9
@@ -90,6 +90,15 @@ func resetIPSets(ips ipset.Interface) error {
|
||||
|
||||
common.Log.Debugf("Got list of ipsets: %v", sets)
|
||||
|
||||
// Must remove references to ipsets by other ipsets before they're destroyed
|
||||
for _, s := range sets {
|
||||
common.Log.Debugf("Flushing ipset '%s'", string(s))
|
||||
if err := ips.Flush(s); err != nil {
|
||||
common.Log.Errorf("Failed to flush ipset '%s'", string(s))
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, s := range sets {
|
||||
common.Log.Debugf("Destroying ipset '%s'", string(s))
|
||||
if err := ips.Destroy(s); err != nil {
|
||||
|
||||
Reference in new issue
Block a user