Merge pull request #2949 from ocadotechnology/wip-2915
Flush weave ipsets before destroying
This commit is contained in:
commit
255d087416
1 file changed
+10
-1
+10
-1
@@ -90,8 +90,17 @@ func resetIPSets(ips ipset.Interface) error {
|
|||||||
|
|
||||||
common.Log.Debugf("Got list of ipsets: %v", sets)
|
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 {
|
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 {
|
if err := ips.Destroy(s); err != nil {
|
||||||
common.Log.Errorf("Failed to destroy ipset '%s'", string(s))
|
common.Log.Errorf("Failed to destroy ipset '%s'", string(s))
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in new issue
Block a user