feat: add volume, images and networks

This commit is contained in:
2026-05-18 19:30:33 +02:00
parent 4f53aefb6e
commit bd3121d688
10 changed files with 1221 additions and 208 deletions

View File

@ -108,12 +108,21 @@ func (g *Gateway) Tunnel(stream agentv1.AgentGateway_TunnelServer) error {
switch p := msg.Payload.(type) {
case *agentv1.AgentMessage_Snapshot:
g.registry.UpdateContainers(agentID, p.Snapshot.Containers)
g.registry.UpdateResources(agentID, p.Snapshot.Containers, p.Snapshot.Images, p.Snapshot.Volumes, p.Snapshot.Networks)
g.broker.Publish(broker.Event{
Type: "containers.updated",
AgentID: agentID,
Payload: p.Snapshot.Containers,
})
g.broker.Publish(broker.Event{
Type: "resources.updated",
AgentID: agentID,
Payload: map[string]any{
"images": p.Snapshot.Images,
"volumes": p.Snapshot.Volumes,
"networks": p.Snapshot.Networks,
},
})
case *agentv1.AgentMessage_Result:
g.broker.Publish(broker.Event{