Skip to content

Commit

Permalink
[#] add resolved_address for clusters identity
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed Oct 12, 2024
1 parent 871d600 commit 397279a
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/resolver/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Author: Zella Zhong
Date: 2024-10-12 14:10:05
LastEditors: Zella Zhong
LastEditTime: 2024-10-12 17:07:43
LastEditTime: 2024-10-12 17:26:02
FilePath: /data_service/src/resolver/clusters.py
Description:
'''
Expand Down Expand Up @@ -235,6 +235,12 @@ async def query_profile_by_single_clusters(info, query_str):
network=network
)
)
cluster_name_dict[cluster_name].resolved_address.append(
Address(
address=address,
network=network
)
)
cluster_name_dict[cluster_name].profile.addresses.append(
Address(
address=address,
Expand Down Expand Up @@ -262,6 +268,7 @@ async def query_profile_by_single_clusters(info, query_str):
return None

owner_addresses = []
resolved_addresses = []
records = []
platform = Platform.clusters
cluster_name = name_profile_record.get('cluster_name', None)
Expand All @@ -283,6 +290,12 @@ async def query_profile_by_single_clusters(info, query_str):
network=network
)
)
resolved_addresses.append(
Address(
address=address,
network=network
)
)
records.append(
Address(
address=address,
Expand Down Expand Up @@ -310,7 +323,7 @@ async def query_profile_by_single_clusters(info, query_str):
primary_name=None,
is_primary=False,
expired_at=None,
resolved_address=[],
resolved_address=resolved_addresses,
owner_address=owner_addresses,
profile=profile
)
Expand Down Expand Up @@ -349,6 +362,7 @@ async def query_profile_by_batch_clusters(info, batch_clusters_name):
cluster_name_dict = {}
for _, item in profile_dict.items():
owner_addresses = []
resolved_addresses = []
records = []
platform = Platform.clusters
cluster_name = item.get('cluster_name', None)
Expand Down Expand Up @@ -396,6 +410,12 @@ async def query_profile_by_batch_clusters(info, batch_clusters_name):
network=network
)
)
resolved_addresses.append(
Address(
address=address,
network=network
)
)
records.append(
Address(
address=address,
Expand All @@ -408,6 +428,12 @@ async def query_profile_by_batch_clusters(info, batch_clusters_name):
network=network
)
)
cluster_name_dict[cluster_name].resolved_address.append(
Address(
address=address,
network=network
)
)
cluster_name_dict[cluster_name].profile.addresses.append(
Address(
address=address,
Expand Down

0 comments on commit 397279a

Please sign in to comment.