Skip to content

Commit 576ec0f

Browse files
authored
don't append ip to topology ids when not needed (#587)
1 parent eb746d5 commit 576ec0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/utils/ids.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ export const getPeerId = (fields: Partial<TopologyMetricPeer>): string => {
4040
if (fields.owner) {
4141
parts.push('o=' + fields.owner.type + '.' + fields.owner.name);
4242
}
43+
// add either resource info or address but not both
44+
// as some items can have multiple IPs
4345
if (fields.resource) {
4446
parts.push('r=' + fields.resource.type + '.' + fields.resource.name);
45-
}
46-
if (fields.addr) {
47+
} else if (fields.addr) {
4748
parts.push('a=' + fields.addr);
4849
}
4950
return parts.length > 0 ? parts.join(',') : idUnknown;

0 commit comments

Comments
 (0)