diff --git a/packages/portal-api/lib/data/transform.js b/packages/portal-api/lib/data/transform.js index 6c612dc8..4631da57 100644 --- a/packages/portal-api/lib/data/transform.js +++ b/packages/portal-api/lib/data/transform.js @@ -176,7 +176,7 @@ exports.fromInstance = function (instance) { deploymentGroupId: instance.deployment_group_id, status: instance.status, healthy: instance.healthy, - watchers: instance.watchers, + watches: instance.watches, jobs: instance.jobs }; }; @@ -191,7 +191,7 @@ exports.toInstance = function (clientInstance) { service_id: clientInstance.serviceId, status: clientInstance.status, healthy: clientInstance.healthy, - watchers: clientInstance.watchers, + watches: clientInstance.watches, jobs: clientInstance.jobs }); }; diff --git a/packages/portal-api/lib/watch/container-pilot.js b/packages/portal-api/lib/watch/container-pilot.js index 37e25aee..cdd4c8f7 100644 --- a/packages/portal-api/lib/watch/container-pilot.js +++ b/packages/portal-api/lib/watch/container-pilot.js @@ -266,7 +266,7 @@ module.exports = class ContainerPilotWatcher extends Events { }); } - _saveInstance ({ id, healthy, watchers, jobs }, cb) { + _saveInstance ({ id, healthy, watches, jobs }, cb) { if (!id) { return cb(); } @@ -274,7 +274,7 @@ module.exports = class ContainerPilotWatcher extends Events { this._data.updateInstance({ id, healthy, - watchers, + watches, jobs }, cb); } @@ -438,12 +438,15 @@ module.exports = class ContainerPilotWatcher extends Events { services: ForceArray(dg.services).map((service) => { return Object.assign({}, service, { instances: ForceArray(service.instances).map((instance) => { + const watches = Get(instance, 'cp.Watches', []); + const jobs = Get(instance, 'cp.Services', []).map(({ Name }) => { + return Name; + }); + return Object.assign({}, instance, { healthy: this._resolveInstanceHealth(service, instance), - jobs: Get(instance, 'cp.Services', []).map(({ Name }) => { - return Name; - }), - watches: Get(instance, 'cp.Watches', []) + jobs, + watches }); }) });