Skip to content

Commit

Permalink
ui: [BUGFIX] Fix missing or duplicate service instance health checks (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
johncowen authored and hashicorp-ci committed Jan 29, 2021
1 parent 11bb34c commit beae0f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ui/packages/consul-ui/app/services/repository/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit beae0f5

Please sign in to comment.