diff --git a/internal/app/ptah-agent/ptah_client.go b/internal/app/ptah-agent/ptah_client.go index 1fd3548..33ea4b0 100644 --- a/internal/app/ptah-agent/ptah_client.go +++ b/internal/app/ptah-agent/ptah_client.go @@ -66,7 +66,11 @@ func (a *Agent) sendStartedEvent(ctx context.Context) (*ptahClient.StartedRes, e nodeData.Role = "worker" } - nodeData.Addr = info.Swarm.NodeAddr + if info.Swarm.NodeAddr != "" { + nodeData.Addr = info.Swarm.NodeAddr + } else { + nodeData.Addr = nets[0].IPs[0].IP + } startedReq := ptahClient.StartedReq{ NodeData: nodeData,