1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-25 06:49:23 +01:00

fix: fixes broken cpu and memory limits on swarm mode. correctly implements limits with agents (#3785)

This commit is contained in:
Amir Raminfar
2025-04-09 15:02:38 -07:00
committed by GitHub
parent ddff265023
commit 70c23b0b1e
10 changed files with 453 additions and 298 deletions

View File

@@ -192,19 +192,21 @@ func (s *server) FindContainer(ctx context.Context, in *pb.FindContainerRequest)
return &pb.FindContainerResponse{
Container: &pb.Container{
Id: container.ID,
Name: container.Name,
Image: container.Image,
Command: container.Command,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
Id: container.ID,
Name: container.Name,
Image: container.Image,
Command: container.Command,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
MemoryLimit: container.MemoryLimit,
CpuLimit: container.CPULimit,
},
}, nil
}
@@ -236,20 +238,22 @@ func (s *server) ListContainers(ctx context.Context, in *pb.ListContainersReques
}
pbContainers = append(pbContainers, &pb.Container{
Id: container.ID,
Name: container.Name,
Image: container.Image,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
Stats: pbStats,
Command: container.Command,
Id: container.ID,
Name: container.Name,
Image: container.Image,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
Stats: pbStats,
Command: container.Command,
MemoryLimit: container.MemoryLimit,
CpuLimit: container.CPULimit,
})
}
@@ -282,18 +286,20 @@ func (s *server) StreamContainerStarted(in *pb.StreamContainerStartedRequest, ou
case container := <-containers:
out.Send(&pb.StreamContainerStartedResponse{
Container: &pb.Container{
Id: container.ID,
Name: container.Name,
Image: container.Image,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
Id: container.ID,
Name: container.Name,
Image: container.Image,
Created: timestamppb.New(container.Created),
State: container.State,
Health: container.Health,
Host: container.Host,
Tty: container.Tty,
Labels: container.Labels,
Group: container.Group,
Started: timestamppb.New(container.StartedAt),
Finished: timestamppb.New(container.FinishedAt),
MemoryLimit: container.MemoryLimit,
CpuLimit: container.CPULimit,
},
})
case <-out.Context().Done():