generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow unlimited memory_swap in docker_container (#138)
* feat: allow unlimited memory_swap in docker_container summary: in docker_container, allow `memory_swap: values `unlimited` and `-1` for unlimited container swap usage. `--memory-swap=-1` is a valid docker run value allowing unlimited swap usage. `docker_container` should allow setting this value via `memory_swap` values `unlimited` and `-1` as it sometimes must explicitly be set to prevent docker from attempting to limit swap usage to double the `--memory` value by default. In rootless docker environments, attempting to set `memory-swap` usage limits will result in an error if the user doesn't have the ability to do so. Allowing explicit unlimited swap usage via docker_container will prevent these errors. https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details * Update tests/integration/targets/docker_container/tasks/tests/options.yml * Apply suggestions from code review Co-authored-by: Felix Fontein <[email protected]>
- Loading branch information
1 parent
9ad7d34
commit a512e7f
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/138-docker_container-allow-memory-swap-unlimited.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- "docker_container - allow ``memory_swap: -1`` to set memory swap limit to unlimited. This is useful when the user cannot set memory swap limits due to cgroup limitations or other reasons, as by default Docker will try to set swap usage to two times the value of ``memory`` (https://github.com/ansible-collections/community.docker/pull/138)." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters