Delete persisted data when IPAM range changes

This commit is contained in:
Bryan Boreham committed 2016-05-03 13:20:04 +01:00
1 parent fb3ed9c1a6
commit f6966548eb
2 files changed
+19

No files matched your search

+5
View File
@@ -917,6 +917,11 @@ func (alloc *Allocator) loadPersistedData() bool {
return false
}
if persistedRing.Range() != alloc.universe {
overwritePersisted("Deleting persisted data for IPAM range %s; our range is %s", persistedRing.Range(), alloc.universe)
return false
}
alloc.ring = persistedRing
alloc.space.UpdateRanges(alloc.ring.OwnedRanges())
+14
View File
@@ -0,0 +1,14 @@
#! /bin/bash
. ./config.sh
start_suite "IPAM alloc range change"
weave_on $HOST1 launch --ipalloc-range 10.2.0.0/16
weave_on $HOST1 prime
weave_on $HOST1 stop
weave_on $HOST1 launch --ipalloc-range 10.3.0.0/16
# Ensure allocations can proceed
assert_raises "timeout 10 cat <( start_container $HOST1 )"
end_suite