1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 06:00:06 +02:00

fix(portal-api): assert dg.services when watching cp

This commit is contained in:
Sérgio Ramos 2017-07-12 14:34:43 +01:00 committed by Sérgio Ramos
parent eddc8712b0
commit b97e5679bf
2 changed files with 59 additions and 65 deletions

View File

@ -242,6 +242,10 @@ module.exports = class ContainerPilotWatcher extends Events {
} }
_fetchDeploymentGroupStatus (dg, cb) { _fetchDeploymentGroupStatus (dg, cb) {
if (!dg || !dg.services || !dg.services.length) {
return cb();
}
VAsync.forEachParallel({ VAsync.forEachParallel({
inputs: dg.services, inputs: dg.services,
func: (service, next) => { func: (service, next) => {
@ -368,6 +372,7 @@ module.exports = class ContainerPilotWatcher extends Events {
} }
const dgs = ForceArray((results || {}).successes) const dgs = ForceArray((results || {}).successes)
.filter(Boolean)
.map((dg) => { .map((dg) => {
return Object.assign({}, dg, { return Object.assign({}, dg, {
services: ForceArray(dg.services).map((service) => { services: ForceArray(dg.services).map((service) => {

119
yarn.lock
View File

@ -497,6 +497,10 @@ ast-types@0.9.0:
version "0.9.0" version "0.9.0"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.0.tgz#c8721c8747ae4d5b29b929e99c5317b4e8745623" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.0.tgz#c8721c8747ae4d5b29b929e99c5317b4e8745623"
ast-types@0.9.6:
version "0.9.6"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
async-each@^1.0.0: async-each@^1.0.0:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
@ -524,8 +528,8 @@ auto-bind@^1.1.0:
resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-1.1.0.tgz#93b864dc7ee01a326281775d5c75ca0a751e5961" resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-1.1.0.tgz#93b864dc7ee01a326281775d5c75ca0a751e5961"
automated-readability@^1.0.0: automated-readability@^1.0.0:
version "1.0.0" version "1.0.1"
resolved "https://registry.yarnpkg.com/automated-readability/-/automated-readability-1.0.0.tgz#6460ac2f7f0b5aeef0e8ca7b385d3e8c82ac6c7e" resolved "https://registry.yarnpkg.com/automated-readability/-/automated-readability-1.0.1.tgz#5cf9111efcead6fe13b8c954d425b0068d59949d"
autoprefixer@^6.0.0: autoprefixer@^6.0.0:
version "6.7.7" version "6.7.7"
@ -1493,15 +1497,15 @@ bossy@3.x.x:
joi "10.x.x" joi "10.x.x"
boxen@^1.0.0: boxen@^1.0.0:
version "1.1.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.1.0.tgz#b1b69dd522305e807a99deee777dbd6e5167b102" resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.2.0.tgz#03478d84be7fe02189b80904d81d6a80384368f1"
dependencies: dependencies:
ansi-align "^2.0.0" ansi-align "^2.0.0"
camelcase "^4.0.0" camelcase "^4.0.0"
chalk "^1.1.1" chalk "^2.0.1"
cli-boxes "^1.0.0" cli-boxes "^1.0.0"
string-width "^2.0.0" string-width "^2.0.0"
term-size "^0.1.0" term-size "^1.2.0"
widest-line "^1.0.0" widest-line "^1.0.0"
brace-expansion@^1.1.7: brace-expansion@^1.1.7:
@ -1762,12 +1766,12 @@ camelcase@^4.0.0, camelcase@^4.1.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
caniuse-db@^1.0.30000187, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: caniuse-db@^1.0.30000187, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639:
version "1.0.30000699" version "1.0.30000700"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000699.tgz#5af491ab1c777561a32b43fe253d6a7071ccf979" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000700.tgz#97cfc483865eea8577dc7a3674929b9abf553095"
caniuse-lite@^1.0.30000684: caniuse-lite@^1.0.30000684:
version "1.0.30000699" version "1.0.30000700"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000699.tgz#2a187b737edaa9ebedbbb56edcb53e994eceda0c" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000700.tgz#6084871ec75c6fa62327de97622514f95d9db26a"
capture-stack-trace@^1.0.0: capture-stack-trace@^1.0.0:
version "1.0.0" version "1.0.0"
@ -1843,16 +1847,16 @@ character-entities-html4@^1.0.0:
resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50" resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50"
character-entities-legacy@^1.0.0: character-entities-legacy@^1.0.0:
version "1.1.0" version "1.1.1"
resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz#b18aad98f6b7bcc646c1e4c81f9f1956376a561a" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.1.tgz#f40779df1a101872bb510a3d295e1fccf147202f"
character-entities@^1.0.0: character-entities@^1.0.0:
version "1.2.1" version "1.2.1"
resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.1.tgz#f76871be5ef66ddb7f8f8e3478ecc374c27d6dca" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.1.tgz#f76871be5ef66ddb7f8f8e3478ecc374c27d6dca"
character-reference-invalid@^1.0.0: character-reference-invalid@^1.0.0:
version "1.1.0" version "1.1.1"
resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.0.tgz#dec9ad1dfb9f8d06b4fcdaa2adc3c4fd97af1e68" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.1.tgz#942835f750e4ec61a308e60c2ef8cc1011202efc"
checksum@^0.1.1: checksum@^0.1.1:
version "0.1.1" version "0.1.1"
@ -2486,13 +2490,6 @@ cross-env@^5.0.1:
cross-spawn "^5.1.0" cross-spawn "^5.1.0"
is-windows "^1.0.0" is-windows "^1.0.0"
cross-spawn-async@^2.1.1:
version "2.2.5"
resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc"
dependencies:
lru-cache "^4.0.0"
which "^1.2.8"
cross-spawn@^4, cross-spawn@^4.0.0: cross-spawn@^4, cross-spawn@^4.0.0:
version "4.0.2" version "4.0.2"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41"
@ -3191,7 +3188,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
dependencies: dependencies:
once "^1.4.0" once "^1.4.0"
enhanced-resolve@^3.0.0: enhanced-resolve@^3.3.0:
version "3.3.0" version "3.3.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3"
dependencies: dependencies:
@ -3514,6 +3511,10 @@ esprima@^4.0.0:
version "4.0.0" version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"
esprima@~3.1.0:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
espurify@^1.6.0: espurify@^1.6.0:
version "1.7.0" version "1.7.0"
resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226" resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.7.0.tgz#1c5cf6cbccc32e6f639380bd4f991fab9ba9d226"
@ -3582,17 +3583,6 @@ evp_bytestokey@^1.0.0:
dependencies: dependencies:
create-hash "^1.1.1" create-hash "^1.1.1"
execa@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3"
dependencies:
cross-spawn-async "^2.1.1"
is-stream "^1.1.0"
npm-run-path "^1.0.0"
object-assign "^4.0.1"
path-key "^1.0.0"
strip-eof "^1.0.0"
execa@^0.5.0: execa@^0.5.0:
version "0.5.1" version "0.5.1"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36"
@ -4875,10 +4865,10 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0:
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
is-plain-object@^2.0.1: is-plain-object@^2.0.1:
version "2.0.3" version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.3.tgz#c15bf3e4b66b62d72efaf2925848663ecbc619b6" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
dependencies: dependencies:
isobject "^3.0.0" isobject "^3.0.1"
is-posix-bracket@^0.1.0: is-posix-bracket@^0.1.0:
version "0.1.1" version "0.1.1"
@ -4996,7 +4986,7 @@ isobject@^2.0.0:
dependencies: dependencies:
isarray "1.0.0" isarray "1.0.0"
isobject@^3.0.0: isobject@^3.0.1:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
@ -5913,7 +5903,7 @@ lru-cache@4.0.x:
pseudomap "^1.0.1" pseudomap "^1.0.1"
yallist "^2.0.0" yallist "^2.0.0"
lru-cache@^4.0.0, lru-cache@^4.0.1: lru-cache@^4.0.1:
version "4.1.1" version "4.1.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55"
dependencies: dependencies:
@ -6408,12 +6398,6 @@ normalize-strings@^1.1.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.yarnpkg.com/normalize-strings/-/normalize-strings-1.1.0.tgz#b24a75ed48176394404f74649b5cb8040e899a75" resolved "https://registry.yarnpkg.com/normalize-strings/-/normalize-strings-1.1.0.tgz#b24a75ed48176394404f74649b5cb8040e899a75"
npm-run-path@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f"
dependencies:
path-key "^1.0.0"
npm-run-path@^2.0.0: npm-run-path@^2.0.0:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
@ -6775,10 +6759,6 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
path-key@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af"
path-key@^2.0.0: path-key@^2.0.0:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
@ -7559,7 +7539,7 @@ readline2@^1.0.1:
is-fullwidth-code-point "^1.0.0" is-fullwidth-code-point "^1.0.0"
mute-stream "0.0.5" mute-stream "0.0.5"
recast@0.11.12, recast@^0.11.5: recast@0.11.12:
version "0.11.12" version "0.11.12"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.12.tgz#a79e4d3f82d5d72a82ee177aeaa791e793bbe5d6" resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.12.tgz#a79e4d3f82d5d72a82ee177aeaa791e793bbe5d6"
dependencies: dependencies:
@ -7568,6 +7548,15 @@ recast@0.11.12, recast@^0.11.5:
private "~0.1.5" private "~0.1.5"
source-map "~0.5.0" source-map "~0.5.0"
recast@^0.11.5:
version "0.11.23"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3"
dependencies:
ast-types "0.9.6"
esprima "~3.1.0"
private "~0.1.5"
source-map "~0.5.0"
rechoir@^0.6.2: rechoir@^0.6.2:
version "0.6.2" version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
@ -8305,9 +8294,9 @@ sort-keys@^2.0.0:
dependencies: dependencies:
is-plain-obj "^1.0.0" is-plain-obj "^1.0.0"
source-list-map@^1.1.1: source-list-map@^2.0.0:
version "1.1.2" version "2.0.0"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
source-map-resolve@^0.3.0: source-map-resolve@^0.3.0:
version "0.3.1" version "0.3.1"
@ -8993,11 +8982,11 @@ tempfile@^1.1.1:
os-tmpdir "^1.0.0" os-tmpdir "^1.0.0"
uuid "^2.0.1" uuid "^2.0.1"
term-size@^0.1.0: term-size@^1.2.0:
version "0.1.1" version "1.2.0"
resolved "https://registry.yarnpkg.com/term-size/-/term-size-0.1.1.tgz#87360b96396cab5760963714cda0d0cbeecad9ca" resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69"
dependencies: dependencies:
execa "^0.4.0" execa "^0.7.0"
test-exclude@^4.1.1: test-exclude@^4.1.1:
version "4.1.1" version "4.1.1"
@ -9611,23 +9600,23 @@ weasels@^1.0.0:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/weasels/-/weasels-1.1.1.tgz#3f3c72ac0a8ea19f5714a814c9101e0740857b25" resolved "https://registry.yarnpkg.com/weasels/-/weasels-1.1.1.tgz#3f3c72ac0a8ea19f5714a814c9101e0740857b25"
webpack-sources@^0.2.3: webpack-sources@^1.0.1:
version "0.2.3" version "1.0.1"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"
dependencies: dependencies:
source-list-map "^1.1.1" source-list-map "^2.0.0"
source-map "~0.5.3" source-map "~0.5.3"
webpack@^2.6.1: webpack@^2.6.1:
version "2.6.1" version "2.7.0"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.1.tgz#2e0457f0abb1ac5df3ab106c69c672f236785f07" resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.7.0.tgz#b2a1226804373ffd3d03ea9c6bd525067034f6b1"
dependencies: dependencies:
acorn "^5.0.0" acorn "^5.0.0"
acorn-dynamic-import "^2.0.0" acorn-dynamic-import "^2.0.0"
ajv "^4.7.0" ajv "^4.7.0"
ajv-keywords "^1.1.1" ajv-keywords "^1.1.1"
async "^2.1.2" async "^2.1.2"
enhanced-resolve "^3.0.0" enhanced-resolve "^3.3.0"
interpret "^1.0.0" interpret "^1.0.0"
json-loader "^0.5.4" json-loader "^0.5.4"
json5 "^0.5.1" json5 "^0.5.1"
@ -9641,7 +9630,7 @@ webpack@^2.6.1:
tapable "~0.2.5" tapable "~0.2.5"
uglify-js "^2.8.27" uglify-js "^2.8.27"
watchpack "^1.3.1" watchpack "^1.3.1"
webpack-sources "^0.2.3" webpack-sources "^1.0.1"
yargs "^6.0.0" yargs "^6.0.0"
whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.0: whatwg-fetch@>=0.10.0, whatwg-fetch@^2.0.0:
@ -9667,7 +9656,7 @@ which@1.2.4:
is-absolute "^0.1.7" is-absolute "^0.1.7"
isexe "^1.1.1" isexe "^1.1.1"
which@^1.2.4, which@^1.2.8, which@^1.2.9: which@^1.2.4, which@^1.2.9:
version "1.2.14" version "1.2.14"
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
dependencies: dependencies: