in elastic/shared/runners/remote_cluster.py [0:0]
def _get_seed_nodes(nodes_api_response):
seed_nodes = []
# naively avoid targeting masters on multi node clusters
for n in nodes_api_response["nodes"].values():
if "remote_cluster_client" in n["roles"] and "master" not in n["roles"]:
seed_nodes.append(n["transport_address"])
# maybe we have a single node cluster, or all nodes have all roles
if len(seed_nodes) < 1:
for n in nodes_api_response["nodes"].values():
if "remote_cluster_client" in n["roles"]:
seed_nodes.append(n["transport_address"])
if len(seed_nodes) < 1:
raise Exception(
f"Unable to retrieve any seed nodes for cluster [{nodes_api_response['cluster_name']}]. "
"Ensure that the node(s) have the 'remote_cluster_client' node role assigned under 'node.roles'."
)
return seed_nodes