fix: add advertise_addr when join the swarm, try to fix bugs in docker

This commit is contained in:
Ting-Jun Wang 2024-06-01 13:15:12 +08:00
parent bc476e398f
commit 27ff1c5636
Signed by: snsd0805
GPG Key ID: 48D331A3D6160354

View File

@ -76,7 +76,7 @@ class ClusterCommunicationModule():
# join docker swarm cluster
token = self.client_sock.recv(1024).decode().split(' ')[-1]
print("Receive Docker Swarm Join_Token=", token)
status = self.node_manager.docker_client.swarm.join(remote_addrs=[f'{addr[0]}:2377'], join_token=token)
status = self.node_manager.docker_client.swarm.join(remote_addrs=[f'{addr[0]}:2377'], join_token=token, advertise_addr=f'{addr[0]}:2377')
if not status:
print("Some Errors!")