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
pull/9668/head
John Cowen 4 years ago committed by GitHub
parent 727a402810
commit 7c277aa85b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {

@ -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());

Loading…
Cancel
Save