Added 'ContainerDestroyed()' callback from docker client

This commit is contained in:
Bryan Boreham committed 2016-01-12 14:38:44 +00:00
1 parent 2f885a7906
commit b2b293a8ee
5 files changed
+22 -7

No files matched your search

+11
View File
@@ -239,6 +239,17 @@ func (alloc *Allocator) ContainerDied(ident string) {
}
}
// ContainerDestroyed called from the updater interface. Async.
func (alloc *Allocator) ContainerDestroyed(ident string) {
alloc.actionChan <- func() {
if _, found := alloc.lookupOwned(ident, alloc.universe); found {
alloc.debugln("Container", ident, "destroyed; removing addresses")
alloc.delete(ident)
delete(alloc.dead, ident)
}
}
}
func (alloc *Allocator) removeDeadContainers() {
cutoff := alloc.now().Add(-containerDiedTimeout)
for ident, timeOfDeath := range alloc.dead {