feat(store): persist the Swarm cluster id of each agent

The Ledger UI groups Swarm services under their cluster and lists the
cluster's managers, so the master needs to know which cluster an agent
belongs to. RecordHello now stores hello.SwarmClusterID in the new
agents.swarm_cluster_id column.

Claude-Session: https://claude.ai/code/session_01GAZsp3P7Qto6JnhipxWUJQ
This commit is contained in:
2026-10-13 10:04:58 +02:00
parent 307e46e4c7
commit 9d5f24b125
4 changed files with 12 additions and 7 deletions
+6 -3
View File
@@ -27,9 +27,12 @@ type Agent struct {
Hostname string
AgentVersion string
SwarmManager bool
LastSeenAt *time.Time
RevokedAt *time.Time
CreatedAt time.Time
// SwarmClusterID is the Swarm cluster the agent's daemon was in when it last
// connected; "" outside a swarm.
SwarmClusterID string
LastSeenAt *time.Time
RevokedAt *time.Time
CreatedAt time.Time
}
// Service is one service as last reported by an agent.