mirror of
https://github.com/docker/cli.git
synced 2026-01-23 15:21:32 +03:00
Add support for pids limit in stacks (swarm)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -489,11 +489,22 @@ func fromComposeConstraints(s []string) *latest.Constraints {
|
||||
|
||||
func fromComposeResources(r composeTypes.Resources) latest.Resources {
|
||||
return latest.Resources{
|
||||
Limits: fromComposeResourcesResource(r.Limits),
|
||||
Limits: fromComposeResourcesResourceLimit(r.Limits),
|
||||
Reservations: fromComposeResourcesResource(r.Reservations),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO create ResourceLimit type and support for limiting Pids on k8s
|
||||
func fromComposeResourcesResourceLimit(r *composeTypes.ResourceLimit) *latest.Resource {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
return &latest.Resource{
|
||||
MemoryBytes: int64(r.MemoryBytes),
|
||||
NanoCPUs: r.NanoCPUs,
|
||||
}
|
||||
}
|
||||
|
||||
func fromComposeResourcesResource(r *composeTypes.Resource) *latest.Resource {
|
||||
if r == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user