Delete persisted data when IPAM range changes
This commit is contained in:
1 parent
fb3ed9c1a6
commit
f6966548eb
2 files changed
+19
No files matched your search
@@ -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())
|
||||
|
||||
|
||||
Executable
+14
@@ -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
|
||||
Reference in new issue
Block a user