Merge pull request #2949 from ocadotechnology/wip-2915

Flush weave ipsets before destroying
This commit is contained in:
Bryan Boreham authored and GitHub committed 2017-05-12 13:15:09 +01:00
commit 255d087416
1 file changed
+10 -1
+10 -1
View File
@@ -90,8 +90,17 @@ 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("Destroying ipsets '%s'", string(s))
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 {
common.Log.Errorf("Failed to destroy ipset '%s'", string(s))
return err