diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2019-09-09 14:51:07 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2020-04-15 22:37:42 +0200 |
commit | 157c53c8e00a0e97eb6bd5f6b041c8cde96e5d3b (patch) | |
tree | 6977165a36b3f830368184f73b06066a0a964035 /integration/internal | |
parent | f4b067356562fd061705977786032aae35d06583 (diff) | |
download | docker-157c53c8e00a0e97eb6bd5f6b041c8cde96e5d3b.tar.gz |
Add API support for PidsLimit on services
Support for PidsLimit was added to SwarmKit in docker/swarmkit/pull/2415,
but never exposed through the Docker remove API.
This patch exposes the feature in the repote API.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'integration/internal')
-rw-r--r-- | integration/internal/swarm/service.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/integration/internal/swarm/service.go b/integration/internal/swarm/service.go index efd52609bc..1ee5004860 100644 --- a/integration/internal/swarm/service.go +++ b/integration/internal/swarm/service.go @@ -196,6 +196,14 @@ func ServiceWithCapabilities(Capabilities []string) ServiceSpecOpt { } } +// ServiceWithPidsLimit sets the PidsLimit option of the service's ContainerSpec. +func ServiceWithPidsLimit(limit int64) ServiceSpecOpt { + return func(spec *swarmtypes.ServiceSpec) { + ensureContainerSpec(spec) + spec.TaskTemplate.ContainerSpec.PidsLimit = limit + } +} + // GetRunningTasks gets the list of running tasks for a service func GetRunningTasks(t *testing.T, c client.ServiceAPIClient, serviceID string) []swarmtypes.Task { t.Helper() |