mirror of https://github.com/status-im/consul.git
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
This commit is contained in:
parent
727a402810
commit
7c277aa85b
|
@ -41,7 +41,9 @@ export default class ProxyService extends RepositoryService {
|
||||||
return this.findAllBySlug(slug, dc, nspace, configuration).then(function(items) {
|
return this.findAllBySlug(slug, dc, nspace, configuration).then(function(items) {
|
||||||
let res = {};
|
let res = {};
|
||||||
if (get(items, 'length') > 0) {
|
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) {
|
if (instance) {
|
||||||
res = instance;
|
res = instance;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -48,10 +48,13 @@ export default class ServiceInstanceService extends RepositoryService {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Copy over all the things to the ProxyServiceInstance
|
// Copy over all the things to the ProxyServiceInstance
|
||||||
['Service', 'Node'].forEach(prop => {
|
['Service', 'Node', 'meta'].forEach(prop => {
|
||||||
set(proxy, prop, instance[prop]);
|
set(proxy, prop, instance[prop]);
|
||||||
});
|
});
|
||||||
['Checks'].forEach(prop => {
|
['Checks'].forEach(prop => {
|
||||||
|
// completely wipe out any previous values so we don't accumulate things
|
||||||
|
// eternally
|
||||||
|
proxy.set(prop, []);
|
||||||
instance[prop].forEach(item => {
|
instance[prop].forEach(item => {
|
||||||
if (typeof item !== 'undefined') {
|
if (typeof item !== 'undefined') {
|
||||||
proxy[prop].addFragment(item.copy());
|
proxy[prop].addFragment(item.copy());
|
||||||
|
|
Loading…
Reference in New Issue