feat: add volume, images and networks
This commit is contained in:
@ -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{
|
||||
|
||||
Reference in New Issue
Block a user