1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 07:56:37 +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

@@ -388,8 +388,6 @@ func newContainerFromJSON(c docker.InspectResponse, host string) container.Conta
group = c.Config.Labels["dev.dozzle.group"]
}
log.Debug().Float64("limit", float64(c.HostConfig.NanoCPUs)/1e9).Int64("nanoCPU", c.HostConfig.NanoCPUs).Msgf("Quota for container id=%s", c.ID)
container := container.Container{
ID: c.ID[:12],
Name: name,
@@ -401,7 +399,7 @@ func newContainerFromJSON(c docker.InspectResponse, host string) container.Conta
Stats: utils.NewRingBuffer[container.ContainerStat](300), // 300 seconds of stats
Group: group,
Tty: c.Config.Tty,
MemoryLimit: c.HostConfig.Memory,
MemoryLimit: uint64(c.HostConfig.Memory),
CPULimit: float64(c.HostConfig.NanoCPUs) / 1e9,
FullyLoaded: true,
}