makeusabrew / decking

A Docker helper to create, manage and run clusters of containers
http://decking.io
443 stars 36 forks source link

Nested dependencies, TypeError #95

Open DirkHeinke opened 9 years ago

DirkHeinke commented 9 years ago

With the following dependencies file, decking crashes:

{
"containers": {
  "t100_1": {
    "image": "t100_a:1",
    "dependencies": [ "t100_2:t12" ],
    "extra": "sleep 100"
  },
  "t100_2": {
    "image": "t100_a:2",
    "dependencies": [ "t100_3:t13" ],
    "extra": "sleep 100"
  },
  "t100_3": {
    "image": "t100_a:3",
    "extra": "sleep 100"
  }
},
"clusters": {
  "main": ["t100_1"]
}
}

The error is:

TypeError: Cannot read property 'count' of undefined
    at /usr/lib/node_modules/decking/lib/cluster.js:97:38
    at arrayMap (/usr/lib/node_modules/decking/node_modules/lodash/index.js:1406:25)
    at Function.map (/usr/lib/node_modules/decking/node_modules/lodash/index.js:6710:14)
    at Cluster.addNodes (/usr/lib/node_modules/decking/lib/cluster.js:95:15)
    at Cluster.resolveContainers (/usr/lib/node_modules/decking/lib/cluster.js:88:24)
    at Decking.create (/usr/lib/node_modules/decking/lib/decking.js:394:18)
    at Decking._run (/usr/lib/node_modules/decking/lib/decking.js:377:19)
    at Decking.commands.create (/usr/lib/node_modules/decking/lib/decking.js:137:17)
    at Decking.execute (/usr/lib/node_modules/decking/lib/decking.js:92:13)
    at Immediate._onImmediate (/usr/lib/node_modules/decking/bin/decking:25:20)

Basically t100_1 needs t100_2, which needs t100_3. Is this a supported scenario?