Skip to content

Commit

Permalink
don't append ip to topology ids when not needed (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau authored Sep 20, 2024
1 parent eb746d5 commit 576ec0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/utils/ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ export const getPeerId = (fields: Partial<TopologyMetricPeer>): string => {
if (fields.owner) {
parts.push('o=' + fields.owner.type + '.' + fields.owner.name);
}
// add either resource info or address but not both
// as some items can have multiple IPs
if (fields.resource) {
parts.push('r=' + fields.resource.type + '.' + fields.resource.name);
}
if (fields.addr) {
} else if (fields.addr) {
parts.push('a=' + fields.addr);
}
return parts.length > 0 ? parts.join(',') : idUnknown;
Expand Down

0 comments on commit 576ec0f

Please sign in to comment.