From 345d29c5d6dcc24748c856376d59024f5ad848cc Mon Sep 17 00:00:00 2001 From: Bohdan Shulha Date: Sun, 25 Aug 2024 16:00:41 +0200 Subject: [PATCH] feat: send the current node (internal) addr on startup --- internal/app/ptah-agent/ptah_client.go | 2 ++ internal/pkg/ptah-client/events.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/app/ptah-agent/ptah_client.go b/internal/app/ptah-agent/ptah_client.go index d8816e5..afb9a4f 100644 --- a/internal/app/ptah-agent/ptah_client.go +++ b/internal/app/ptah-agent/ptah_client.go @@ -62,6 +62,8 @@ func (a *Agent) sendStartedEvent(ctx context.Context) (*ptahClient.StartedRes, e nodeData.Role = "worker" } + nodeData.Addr = info.Swarm.NodeAddr + startedReq := ptahClient.StartedReq{ NodeData: nodeData, SwarmData: nil, diff --git a/internal/pkg/ptah-client/events.go b/internal/pkg/ptah-client/events.go index aed630c..08f1b87 100644 --- a/internal/pkg/ptah-client/events.go +++ b/internal/pkg/ptah-client/events.go @@ -30,6 +30,7 @@ type NodeData struct { Networks []networks.Network `json:"networks"` } `json:"host"` Role string `json:"role"` + Addr string `json:"addr"` } type StartedReq struct {