Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit fa4d028

Browse files
committed
apply single ulimit as soft+hard limit
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent da2d644 commit fa4d028

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

local/compose/create.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,18 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
438438
}
439439

440440
for name, u := range s.Ulimits {
441+
soft := u.Single
442+
if u.Soft != 0 {
443+
soft = u.Soft
444+
}
445+
hard := u.Single
446+
if u.Hard != 0 {
447+
hard = u.Hard
448+
}
441449
resources.Ulimits = append(resources.Ulimits, &units.Ulimit{
442450
Name: name,
443-
Hard: int64(u.Hard),
444-
Soft: int64(u.Soft),
451+
Hard: int64(soft),
452+
Soft: int64(hard),
445453
})
446454
}
447455
return resources

0 commit comments

Comments
 (0)