From 7c277aa85b1c18799cfd506559bd08f780208e3a Mon Sep 17 00:00:00 2001 From: John Cowen Date: Fri, 29 Jan 2021 15:51:23 +0000 Subject: [PATCH] ui: [BUGFIX] Fix missing or duplicate service instance health checks (#9660) * Use NodeName not Node for cross checking proxies/instances * Also copy over the meta data to keep the correct cursor/index * When we sync checks to the ProxyInstance replace rather than accumulate --- ui/packages/consul-ui/app/services/repository/proxy.js | 4 +++- .../consul-ui/app/services/repository/service-instance.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/packages/consul-ui/app/services/repository/proxy.js b/ui/packages/consul-ui/app/services/repository/proxy.js index e0fa741433..df0563afb6 100644 --- a/ui/packages/consul-ui/app/services/repository/proxy.js +++ b/ui/packages/consul-ui/app/services/repository/proxy.js @@ -41,7 +41,9 @@ export default class ProxyService extends RepositoryService { return this.findAllBySlug(slug, dc, nspace, configuration).then(function(items) { let res = {}; if (get(items, 'length') > 0) { - let instance = items.filterBy('ServiceProxy.DestinationServiceID', id).findBy('Node', node); + let instance = items + .filterBy('ServiceProxy.DestinationServiceID', id) + .findBy('NodeName', node); if (instance) { res = instance; } else { diff --git a/ui/packages/consul-ui/app/services/repository/service-instance.js b/ui/packages/consul-ui/app/services/repository/service-instance.js index 1ce1a2426b..49399ed09d 100644 --- a/ui/packages/consul-ui/app/services/repository/service-instance.js +++ b/ui/packages/consul-ui/app/services/repository/service-instance.js @@ -48,10 +48,13 @@ export default class ServiceInstanceService extends RepositoryService { // } // Copy over all the things to the ProxyServiceInstance - ['Service', 'Node'].forEach(prop => { + ['Service', 'Node', 'meta'].forEach(prop => { set(proxy, prop, instance[prop]); }); ['Checks'].forEach(prop => { + // completely wipe out any previous values so we don't accumulate things + // eternally + proxy.set(prop, []); instance[prop].forEach(item => { if (typeof item !== 'undefined') { proxy[prop].addFragment(item.copy());