Don't crash when dockerCli is nil

This commit is contained in:
Bryan Boreham committed 2016-08-03 14:28:05 +01:00
1 parent ed83efbceb
commit 7ebf3d7a88
1 file changed
+5 -3
+5 -3
View File
@@ -298,9 +298,11 @@ func main() {
}
allocator, defaultSubnet = createAllocator(router, ipamConfig, db, t, isKnownPeer)
observeContainers(allocator)
ids, err := dockerCli.AllContainerIDs()
checkFatal(err)
allocator.PruneOwned(ids)
if dockerCli != nil {
ids, err := dockerCli.AllContainerIDs()
checkFatal(err)
allocator.PruneOwned(ids)
}
}
var (