1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

feat: adds limit to docker containers (#3766)

This commit is contained in:
Amir Raminfar
2025-04-08 08:57:33 -07:00
committed by GitHub
parent df7e461876
commit f363b6f366
13 changed files with 85 additions and 19 deletions

View File

@@ -24,6 +24,8 @@ type Container struct {
Tty bool `json:"-"`
Labels map[string]string `json:"labels,omitempty"`
Stats *utils.RingBuffer[ContainerStat] `json:"stats,omitempty"`
MemoryLimit int64 `json:"memoryLimit"`
CPULimit float64 `json:"cpuLimit"`
Group string `json:"group,omitempty"`
FullyLoaded bool `json:"-,omitempty"`
}
@@ -54,7 +56,7 @@ func ParseContainerFilter(commaValues string) (ContainerLabels, error) {
return filter, nil
}
for _, val := range strings.Split(commaValues, ",") {
for val := range strings.SplitSeq(commaValues, ",") {
pos := strings.Index(val, "=")
if pos == -1 {
return nil, fmt.Errorf("invalid filter: %s", filter)