Commit Graph

472 Commits

Author SHA1 Message Date
Felix Fontein
3cc27ecd65
Handle yet another random unstructured error output. (#949) 2024-08-07 15:58:23 +02:00
Felix Fontein
d91f854d45
Fix composition of --output parameters. (#947) 2024-08-01 17:22:10 +02:00
Felix Fontein
c3aceebd7d
Docker* connection plugins: add working_dir and privileged options (#943)
* Add working_dir option.

* Add privileged option.

* Add basic tests.

* Also test privileged.
2024-07-25 20:35:32 +00:00
Felix Fontein
7464002bc3
Docker* connection plugins: allow to pass extra environment variables when running commands (#940)
* Allow to pass extra environment variables when running commands.

* Make compatible with older Python.

* Remove env and ini sources for extra_env.
2024-07-25 21:26:15 +02:00
Felix Fontein
0fe84b510b
docker_compose_v2_pull: add new options ignore_buildable, include_deps, and services; fix service CLI for docker_compose_v2 module (#942)
* Add new options for --ignore-buildable, --include-deps, and for providing services.

* Add services after -- and not before.
2024-07-25 20:47:32 +02:00
Felix Fontein
45b2531129
docker_compose_v2* modules: use --progress json for Compose 2.29.0+ (#931)
* Use --progress json for Compose 2.29.0+.

* Add changelog fragment.

* Fix/improve handling of warnings.

* Improve parsing of warnings and some one-off messages.

* Improve warnings.

* Handle tail messages.

* Fix bug in regular event parsing.
2024-07-25 18:33:42 +02:00
Felix Fontein
ebec16d42c
Handle network_mode=default correctly for Docker 26.1.0+. (#936) 2024-07-25 18:30:12 +02:00
Felix Fontein
2ddadf1e2b
docker_container: pass networks to Daemon on container creation (#933)
* Pass networks to Daemon on container creation.

* Restore old behavior, and only provide all networks on creation for API 1.44+.
2024-07-23 17:34:26 +02:00
Felix Fontein
11ce793f7d Prepare 3.12.0 release. 2024-07-20 17:07:34 +02:00
Felix Fontein
22bbfbaf8b
CLI modules: improve docker version/info output processing, avoid querying for API version if it's not needed (#935)
* Don't assume that docker version/info JSON output contains the expected fields.

* Allow CLI modules to not require the API version.

* Add changelog fragment.
2024-07-20 15:51:02 +02:00
Felix Fontein
609fa2c8b4 Reformat and re-order changelogs/changelog.yaml. 2024-07-11 22:44:27 +02:00
Felix Fontein
65d8dc8908 Release 3.11.0. 2024-07-09 22:13:38 +02:00
Felix Fontein
4b7e74b75e
docker_container: allow to wait for a container to become healthy (#921)
* Allow to wait for a container to become healthy.

* Improve wording.

Co-authored-by: Don Naro <dnaro@redhat.com>

* Improve explanation.

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2024-07-09 20:07:00 +02:00
Felix Fontein
6fcbd34e23
Prevent infinite loop. (#922) 2024-07-07 23:18:58 +02:00
Felix Fontein
48c0cdf2c5
Imporve parsing of skipped messages. (#916) 2024-07-06 21:10:39 +02:00
Fran Jurinec
9b5dbd4543
Add support from device_cgroup_rules parameter (#910) 2024-07-04 09:51:32 +02:00
Felix Fontein
81cabbf697
CI: Run some tests with the latest development versions of Docker SDK for Python, requests, and urllib3 (#902)
* Run some tests with the latest development versions of Docker SDK for Python, requests, and urllib3.

* Use LooseVersion instead of StrictVersion to parse urllib3 versions.
2024-06-29 18:57:08 +02:00
Felix Fontein
ad9d362336
Make docker_host and cli_context mutually exclusive. (#895) 2024-06-28 22:26:34 +02:00
Felix Fontein
3383cd551e Release 3.10.4. 2024-06-16 22:04:40 +02:00
Felix Fontein
4cac2ac021
Make sure that one of project_src and definition is provided. (#886) 2024-06-16 21:49:20 +02:00
Felix Fontein
a5b5681608 Prepare 3.10.4 release. 2024-06-16 21:10:13 +02:00
Felix Fontein
691bc6de72
Docker Compose v1 tests: restrict API version to 1.44 if default API version is 1.45+ (#881)
* Restrict API version to 1.44 if default API version is 1.45+.

* Set COMPOSE_API_VERSION if api_version is provided.

* Add changelog.
2024-06-14 08:02:12 +02:00
Felix Fontein
9e7b5407fd Release 3.10.3. 2024-05-26 20:48:21 +02:00
Felix Fontein
de7729c33c Prepare 3.10.3 release. 2024-05-26 16:39:21 +02:00
Felix Fontein
205867e392
Avoid using the deprecated selectors compat module utils. (#871) 2024-05-25 09:00:18 +02:00
Felix Fontein
260b2859c5 Release 3.10.2. 2024-05-21 21:03:51 +02:00
Felix Fontein
32612dc6ec Prepare 3.10.2 release. 2024-05-21 19:23:25 +02:00
Felix Fontein
1b50cee901
Add fix for requests 2.32.2+. (#864) 2024-05-21 19:22:39 +02:00
Felix Fontein
b9add7b415 Release 3.10.1. 2024-05-20 21:44:19 +02:00
Felix Fontein
570f5fb524 Add known_issues instead of extended release summary. 2024-05-20 21:27:43 +02:00
Felix Fontein
8cbec47816 Prepare 3.10.1 release. 2024-05-20 21:12:32 +02:00
Felix Fontein
ab8b6662c2
Add hotfix for requests 2.32.0. (#861) 2024-05-20 21:08:25 +02:00
Felix Fontein
daa253a62d
From now on automatically add period to new plugins in changelog, and use FQCNs. (#859) 2024-05-20 08:50:29 +02:00
Felix Fontein
b6e698c1de Release 3.10.0. 2024-05-19 21:05:29 +02:00
Felix Fontein
97ea49cc17 Prepare 3.10.0 release. 2024-05-18 16:27:10 +02:00
x4rd0o1Vtx
5016a96eba
Allow healthcheck override without test option (#847)
* Add healthcheck test_cli_compatible option

* Update plugins/module_utils/util.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/docker_container.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-15 18:45:01 +02:00
Felix Fontein
36c118d154
Deprecate ssl_version. (#853) 2024-05-11 15:53:19 +02:00
Felix Fontein
f2a5d6f872
docker_image_build: allow to specify multiple platforms, allow to specify secrets and outputs (#852)
* Add note on idempotency.

* Make platform a list of strings.

* Support specifying secrets.

* Add test for secrets.

* Support specifying outputs.

* Ignore invalid choices syntax for ansible-core <= 2.16.

It actually works with ansible-core 2.14+ (though not with <= 2.13),
but the sanity tests only accept it from 2.17 on.

* Only use --secret with type=env for buildx 0.6.0+, and multiple --output for buildx 0.13.0+.
2024-05-11 15:52:47 +02:00
x4rd0o1Vtx
a4a05e7fa5
Add healthcheck start-interval option (#848) 2024-05-09 21:22:06 +02:00
Felix Fontein
f51ca84197
docker_prune: add new options for cleaning build caches (#845)
* Add new options for cleaning build caches to docker_prune.

* Add tests.
2024-05-09 17:12:36 +02:00
Kenny Millington
9beac01ce1
docker_network: Add support for --config-from and --config-only (#843)
Co-authored-by: Felix Fontein <felix@fontein.de>
2024-05-04 15:16:34 +02:00
Felix Fontein
30faf0b8e6
Deprecate Docker Compose v1. (#833) 2024-05-04 13:15:53 +00:00
Florian
368d616229
Add sysctls option to docker_swarm_service (#836)
* add sysctls option to docker_swarm_service

* Add added version number

Co-authored-by: Felix Fontein <felix@fontein.de>

* version added -> 3.10.0

Co-authored-by: Felix Fontein <felix@fontein.de>

* changelog fragment for docker_swarm_service sysctls

* add minimal docker_py / docker_api versions to use for sysctls

* set expected sysctls to null on integration test

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-04-30 22:44:25 +02:00
Felix Fontein
379ce23270 Release 3.9.0 2024-04-21 16:20:52 +02:00
Felix Fontein
8bcc3519d4
Add check_files_existing option. (#839) 2024-04-21 16:01:07 +02:00
Felix Fontein
6368854a8c Prepare 3.9.0 release. 2024-04-20 10:51:16 +02:00
Felix Fontein
cab1bcb96e
Include changelog in docsite (#837)
* Include changelog in docsite.

* Fix changelog.
2024-04-18 12:50:33 +02:00
Felix Fontein
1ee9109a73
Make wrapping variables as unsafe smarter to avoid triggering an AWX bug. (#835) 2024-04-18 07:52:15 +02:00
Felix Fontein
8ad45286a3
Remove unused code that relies on functionality deprecated in Python 3.12. (#834) 2024-04-15 11:21:46 +00:00
Felix Fontein
9e8c367c47
docker_compose_v2: allow to specify inline compose definitions (#832)
* Allow to specify inline compose definitions.

* Remove comma that trips Python 2.7.

* Add tests.

* Add PyYAML as EE dependency.

* Be more explicit on PyYAML.
2024-04-09 17:41:12 +02:00
Felix Fontein
2925334a1a
Make sure project_src is an absolute path. (#828) 2024-04-04 21:39:38 +02:00
Felix Fontein
7102d38923
Better error message if Compose version is 'dev'. (#826) 2024-03-29 19:29:14 +01:00
Felix Fontein
59a8220c7f Release 3.8.1. 2024-03-16 20:16:57 +01:00
Felix Fontein
61c54874fd Prepare 3.8.1 release. 2024-03-15 07:34:43 +01:00
Felix Fontein
bf1281ae7f
Prevent RCE via inventory plugins (#815)
* Prevent RCE via inventory plugins.

* Do not make ansible_connection unsafe.

* Add test.
2024-03-14 20:08:41 +01:00
Felix Fontein
4bab9a6b0e
Fix idempotency of docker_compose_v2_pull. (#814) 2024-03-13 13:20:11 +01:00
Felix Fontein
6aea7efed9
Improve parsing of warnings and errors (#811)
* Add logfmt message parser.

* Parse logfmt formatted warnings.

* Follow-up for #810.

* Fix handling of warning and error messages.

* Make Python 2 compatible.

* Linting. Improving tests.
2024-03-03 13:38:55 +00:00
Felix Fontein
37e28b62d3
Do not fail on non-fatal errors. (#810) 2024-02-28 21:43:30 +01:00
Felix Fontein
eafa7d03a8 Release 3.8.0. 2024-02-25 20:58:22 +01:00
Felix Fontein
bbc36e9923 Prepare 3.8.0 release. 2024-02-23 20:06:07 +01:00
Felix Fontein
45d32d53c9
Do not consider 'Waiting' events as changes/actions. (#804) 2024-02-23 19:58:40 +01:00
Felix Fontein
6f5d67860c
docker_compose_v2: ignore some pull events (#803)
* Ignore some pull events.

* Adjust tests.
2024-02-23 18:24:16 +01:00
Felix Fontein
6366464812
docker_container: allow pull=never, and make check mode behavior configurable (#797)
* Allow to configure behavior of pull=true in check mode.

* Change pull to option that accepts some strings as well, such as pull=never.

* Adjust values.
2024-02-14 22:49:22 +01:00
Felix Fontein
e494464e56
Add wait and wait_timeout options. (#796) 2024-02-14 22:48:36 +01:00
Felix Fontein
b5de1fd1ad
Add MarkDown changelog and use it by default. (#788) 2024-02-09 13:08:24 +01:00
Felix Fontein
7b554082ea
Improve parsing. (#786) 2024-02-01 17:52:31 +00:00
Felix Fontein
810bf738d7 Release 3.7.0. 2024-01-27 13:03:00 +01:00
Felix Fontein
b5d085bb88
Parse build events from stderr. (#779) 2024-01-25 06:40:32 +01:00
Felix Fontein
cc32e0e6ad Prepare 3.7.0. 2024-01-24 07:27:56 +01:00
Felix Fontein
32cb76b164
Add scale option. (#776) 2024-01-24 07:16:33 +01:00
Felix Fontein
eebb73a503
docker_compose_v2: add files option (#775)
* Add files option.

* Shorten lines.
2024-01-24 07:15:00 +01:00
Felix Fontein
a53ecb6e66
Forgot to add docker_compose_v2_pull to action group. (#773) 2024-01-21 22:04:27 +01:00
Felix Fontein
564d3f389f Release 3.6.0. 2024-01-21 09:01:17 +01:00
Felix Fontein
fcf608b334
Add networks[].mac_address option. (#763) 2024-01-20 14:23:12 +01:00
Felix Fontein
ac41379119
Fix archive idempotency. (#765) 2024-01-20 14:12:55 +01:00
Felix Fontein
b2cee5677a Next expected release will be 3.6.0. 2024-01-18 08:20:29 +01:00
Felix Fontein
31540c43d6 Release 3.6.0-rc1. 2024-01-18 08:06:02 +01:00
Felix Fontein
eb3e0b17cd Prepare 3.6.0-rc1 release. 2024-01-18 07:41:45 +01:00
Felix Fontein
4dd671248c Next expected release is 3.6.0. 2024-01-14 16:57:14 +01:00
Felix Fontein
5eb115cb10 Release 3.6.0-b2. 2024-01-14 16:34:25 +01:00
Felix Fontein
daf32ed6ec Remove part that's already in the regular changelog. 2024-01-14 08:55:32 +01:00
Felix Fontein
1c8272f821
Change Docker Stack modules to use common CLI module framework. (#745) 2024-01-14 08:54:06 +01:00
Felix Fontein
b84c771fc5 Prepare 3.6.0-b2. 2024-01-13 16:21:27 +01:00
Felix Fontein
f429017d94
Add inventory filter capability (#698)
* Add inventory filter capability.

* Use community.library_inventory_filtering_v1 collection.

* Bump dependency to 1.0.0.

* Mention the new dependency in the changelog.
2024-01-13 15:51:02 +01:00
Felix Fontein
4a5293503e
Rename ca_cert option to ca_path (#744)
* Rename ca_cert option to ca_path.

* Two more.
2024-01-06 17:03:39 +01:00
Felix Fontein
22d595eddb Next expected release is 3.6.0. 2024-01-04 23:14:15 +01:00
Felix Fontein
7d680aa102 Release 3.6.0-b1. 2024-01-04 22:44:56 +01:00
Felix Fontein
7c61325a83 3.6.0 -> 3.6.0-b1. 2024-01-04 21:53:06 +01:00
Felix Fontein
7aa9791ea6 Prepare 3.6.0 release. 2024-01-02 15:31:58 +01:00
Felix Fontein
199d9e50d3
Fix Unix socket path. (#736) 2024-01-01 22:53:58 +01:00
Felix Fontein
0812d0b495
Support labels and shm_size for image build. Allow to specify (swap) memory limits in other units than bytes. (#727) 2023-12-28 21:42:55 +01:00
Felix Fontein
080a2d68c1 Release 3.5.0. 2023-12-10 09:27:58 +01:00
Felix Fontein
c4c347c626
Add proper platform handling. (#705) 2023-12-10 09:03:32 +01:00
Felix Fontein
b3ef5f5196
Clean up vendored Docker SDK for Python TLS handling code. (#722) 2023-12-09 23:19:36 +01:00
Felix Fontein
26772304f9
Do not accept tls_hostname for Docker SDK for Python 7.0.0+. (#721) 2023-12-09 23:16:03 +01:00
Felix Fontein
a120794958 Prepare 3.5.0 release. 2023-12-09 22:06:03 +01:00
Felix Fontein
3aa1ddcca0
Docker SDK for Python 7+: make sure that ssl_version is not passed, and error out if it was explicitly set (#715)
* Do not accept ssl_version for Docker SDK for Python 7.0.0+.

* Add changelog fragment.

* Generally avoid sending None values to TLSConfig. Potentially prevents similar errors in the future, assuming the users do not pass values in.

* Python 2.6 compatibility.
2023-12-09 17:59:06 +00:00
Felix Fontein
907dc28f73
Deprecate default 'ignore' of 'image_name_mismatch'. (#703) 2023-12-07 12:32:50 +01:00
Felix Fontein
d8cef6c71e
docker_container: refactoring preparing better comparisons (#713)
* Always get the container's image as well to allow get_value() to use that one too.

* Allow options and engines to overwrite comparison functions.

* Do not fail if image (by ID) cannot be found.

* Allow to control when container image is needed.

* Pass option to compare function.

* Allow to pass the host info for retrieving a value.

* Add changelog fragment.
2023-12-05 07:26:11 +01:00
Felix Fontein
1052ce2ded Release 3.4.11. 2023-11-12 12:04:56 +01:00
Alexander Jähnel
4c220c4d74
fix(community.docker.docker_volume): labels can be none (#702)
* fix(community.docker.docker_volume): labels can be none

catch case where volume labels can are done (default) eg:

$ docker volume inspect foo
[    
    {
        "CreatedAt": "2023-11-11T12:55:23+01:00",                                                                                                            
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/foo/_data",
        "Name": "foo",
        "Options": {},
        "Scope": "local"
    }
]

* Update plugins/modules/docker_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add(community.docker.docker_volume): changelog fragment

* Update changelogs/fragments/702-docker-volume-label-none.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-11-12 11:19:56 +01:00
Felix Fontein
9ba09432a7 Prepare 3.4.11 release. 2023-11-12 10:02:23 +01:00
Felix Fontein
ee054c6bf7 Release 3.4.10. 2023-10-29 15:30:46 +01:00
Felix Fontein
a0775fe194 Prepare 3.4.10 release. 2023-10-29 08:32:13 +01:00
Felix Fontein
1c66f880ee
Fix typos, improve markup, improve scenario guide (#699)
* Fix typos.

* Improve markup.

* Mention missing 'new' modules in scenario guide.
2023-10-29 08:30:24 +01:00
Felix Fontein
fbc2750b6a
Do not pass data_path_addr for older Docker SDK for Python versions. (#696) 2023-10-14 23:48:46 +02:00
Felix Fontein
70ea796914 Release 3.4.9. 2023-10-08 21:35:36 +02:00
Felix Fontein
be610963b5 Prepare 3.4.9 release. 2023-10-08 18:38:22 +02:00
Felix Fontein
377f0f7355 Release 3.4.8. 2023-06-22 10:49:45 +02:00
Felix Fontein
a1c5a2d342 Update release summary. 2023-06-22 07:02:40 +02:00
Felix Fontein
5b287b6650 Next expected release is 3.4.8. 2023-06-15 13:35:05 +02:00
Felix Fontein
e5d289a650 Release 3.4.7. 2023-06-15 13:15:25 +02:00
Felix Fontein
440669e76d Prepare 3.4.7 release. 2023-06-15 07:22:20 +02:00
Felix Fontein
748d619fb2
Fix EndpointSpec KeyError. (#637) 2023-05-26 17:58:09 +02:00
Felix Fontein
a284137d15 Release 3.4.6. 2023-05-20 21:14:49 +02:00
Felix Fontein
cdccf955a8 Prepare 3.4.6. 2023-05-20 19:38:28 +02:00
Felix Fontein
1660bf4104
vendored Docker SDK for Python code: update to latest version (#619)
* socket: fix for errors on pipe close in Windows (https://github.com/docker/docker-py/pull/3099)

Need to return data, not size. By returning an empty
string, EOF will be detected properly since `len()`
will be `0`.

Fixes https://github.com/docker/docker-py/issues/3098.

Cherry-picked from f84623225e

Co-authored-by: Milas Bowman <milas.bowman@docker.com>

* socket: use poll() instead of select() except on Windows (https://github.com/docker/docker-py/pull/2865)

Fixes https://github.com/docker/docker-py/issues/2278, which was originally addressed in https://github.com/docker/docker-py/pull/2279, but was not
properly merged. Additionally it did not address the problem
of poll not existing on Windows. This patch falls back on the
more limited select method if host system is Windows.

Cherry-picked from a02ba74333

Co-authored-by: Tyler Westland <tylerofthewest@gmail.com>

* api: respect timeouts on Windows named pipes (https://github.com/docker/docker-py/pull/3112)

Cherry-picked from 9cadad009e

Co-authored-by: Imogen <59090860+ImogenBits@users.noreply.github.com>

* Add URL to changelog.

* api: avoid socket timeouts when executing commands (https://github.com/docker/docker-py/pull/3125)

Only listen to read events when polling a socket in order
to avoid incorrectly trying to read from a socket that is
not actually ready.

Cherry-picked from c5e582c413

Co-authored-by: Loïc Leyendecker <loic.leyendecker@gmail.com>

---------

Co-authored-by: Milas Bowman <milas.bowman@docker.com>
Co-authored-by: Tyler Westland <tylerofthewest@gmail.com>
Co-authored-by: Imogen <59090860+ImogenBits@users.noreply.github.com>
Co-authored-by: Loïc Leyendecker <loic.leyendecker@gmail.com>
2023-05-20 19:35:56 +02:00
Felix Fontein
d7f7e44b9e
Make sure plugins/module_utils/socket_handler.py works when Docker SDK for Python is not installed. (#620) 2023-05-15 21:43:31 +02:00
Felix Fontein
245ab76b09
Warn that SSLSocket cannot send close_notify TLS alerts (#621)
* Warn that SSLSocket cannot send close_notify TLS alerts.

* Improve formulation.

Co-authored-by: Don Naro <dnaro@redhat.com>

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2023-05-15 21:41:23 +02:00
Felix Fontein
ce16a0d5f1 Release 3.4.5. 2023-05-05 22:23:19 +02:00
Felix Fontein
39f2e9b9c4
Make compatible with requests 2.29.0 and urllib3 2.0 (#613)
* Make compatible with requests 2.29.0.

* This fix should also work with urllib3 2.0 according to urllib3 maintainer.

* Add changelog fragment.

* We still need the constraint for CI until Docker SDK for Python has a new release with a fix.

* Make modifications to response_class as small as possible.

* Revert "We still need the constraint for CI until Docker SDK for Python has a new release with a fix."

This reverts commit 698d544a1e08308e8bf8b4e56ab78c5079f9a17b.

* The pip coming with the ansible-core 2.11 alpine3 image seems to be too old.
2023-05-05 22:09:02 +02:00
Felix Fontein
5a26eee6d4 Prepare 3.4.5. 2023-05-05 21:22:57 +02:00
Felix Fontein
0475be5166 Release 3.4.4. 2023-05-01 09:54:42 +02:00
Felix Fontein
ba5b3306a7 Also mention urllib3 2.0.0 in known_issues. 2023-05-01 09:51:38 +02:00
Felix Fontein
4ab05500e3 Prepare 3.4.4 release. 2023-05-01 09:47:48 +02:00
Felix Fontein
088cbaed4e
Restrict requests to < 2.29.0 (#612)
* Restrict requests to < 2.29.0.

* Also avoid urllib3, which gets installed in some cases even though it shouldn't.
2023-04-29 16:25:07 +02:00
Felix Fontein
e0f4c33782 Release 3.4.3. 2023-03-24 07:19:39 +01:00
Felix Fontein
65407001ff Prepare 3.4.3 release. 2023-03-23 21:27:15 +01:00
Felix Fontein
82dde7cadd Release 3.4.2. 2023-02-25 15:37:21 +01:00
Felix Fontein
18584f6b40 Prepare 3.4.2 release. 2023-02-24 21:36:26 +01:00
Felix Fontein
08bfcf7e5f
docker_prune: correctly return 'changed' result (#593)
* Correctly return 'changed' status.

* Extend tests.

* Fix typo.
2023-02-24 17:24:16 +01:00
Felix Fontein
5dd90e5884 Release 3.4.1. 2023-02-20 22:39:26 +01:00
Felix Fontein
983b2b4783
exec: fix file handle leak with container.exec_* APIs (https://github.com/docker/docker-py/pull/2320) (#582)
Requests with stream=True MUST be closed or else the connection will
never be returned to the connection pool. Both ContainerApiMixin.attach
and ExecApiMixin.exec_start were leaking in the stream=False case.
exec_start was modified to follow attach for the stream=True case as
that allows the caller to close the stream when done (untested).

Tested with:

    # Test exec_run (stream=False) - observe one less leak
    make integration-test-py3 file=models_containers_test.py' -k test_exec_run_success -vs -W error::ResourceWarning'
    # Test exec_start (stream=True, fully reads from CancellableStream)
    make integration-test-py3 file=api_exec_test.py' -k test_execute_command -vs -W error::ResourceWarning'

After this change, one resource leak is removed, the remaining resource
leaks occur because none of the tests call client.close().

Fixes https://github.com/docker/docker-py/issues/1293
(Regression from https://github.com/docker/docker-py/pull/1130)

Cherry-picked from 34e6829dd4

Co-authored-by: Peter Wu <pwu@cloudflare.com>
Co-authored-by: Milas Bowman <milas.bowman@docker.com>
2023-02-12 08:29:28 +01:00
Felix Fontein
5c70d8fd7a Prepare 3.4.1 release. 2023-02-10 14:06:22 +01:00
Kristof Mattei
d2f551fc5d
fix: fix tmpfs_size and tmpfs_mode not being set (#580)
* fix: fix tmpfs_size and tmpfs_mode not being set

* fix: wrong file

* fix: add changelog fragment

* fix: update changelog fragment to match formatting

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-02-10 14:05:09 +01:00
Felix Fontein
54a3dc151d
Remove unneccessary imports (#575)
* Remove unneccessary imports.

* Add noqas.
2023-02-09 15:25:45 +01:00
Felix Fontein
96b6f5917d Release 3.4.0. 2023-01-14 11:20:16 +01:00
Felix Fontein
c7cbec0163
docker_plugin: do not crash when plugin doesn't exist (#553)
* Do not crash when plugin doesn't exist.

* Improve style.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-01-13 20:49:06 +01:00
Felix Fontein
4e6ac335f3
Improve envvar fallback handling. (#554) 2023-01-13 06:37:04 +01:00
Felix Fontein
757b02cc15 Prepare 3.4.0 release. 2023-01-09 11:54:13 +01:00
Felix Fontein
e198e4ab43
Add docker_container_copy_into module (#545)
* Move copying functionality to module_utils.

* Add docker_container_copy_into module.

* Use new module in other tests.

* Fix copyright and attributes.

* Improve idempotency, improve stat code.

* Document and test when a stopped container works.

* Improve owner/group detection error handling when container is stopped.

* Fix formulation.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

* Improve file comparison.

* Avoid reading whole file at once.

* Stream when fetching files from daemon.

* Fix comment.

* Use read() instead of read1().

* Stream files when copying into container.

* Linting.

* Add force parameter.

* Simplify library code.

* Linting.

* Add content and content_is_b64 options.

* Make force=false work as for copy module: only copy if the destination does not exist.

* Improve docs.

* content should be no_log.

* Implement diff mode.

* Improve error handling.

* Lint and improve.

* Set owner/group ID to avoid ID lookup (which fails in paused containers).

* Apply suggestions from code review

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-01-09 11:52:29 +01:00
Felix Fontein
18091193de
Fix error handling. (#546) 2023-01-05 09:42:42 +01:00
Felix Fontein
faa7fef504
docker_host_info: allow to list all containers (#538)
* Allow to list all containers.

* Fix typo.
2022-12-27 21:39:17 +01:00
Felix Fontein
b8fb4740a3 Release 3.3.2. 2022-12-09 21:27:38 +01:00
Felix Fontein
6db26903ed Prepare 3.3.2 release. 2022-12-08 22:16:57 +01:00
Felix Fontein
3a40112a76
Remove timeout when waiting for container to finish. (#527) 2022-12-08 22:15:42 +01:00
Felix Fontein
080a043c79 Release 3.3.1. 2022-12-06 13:21:27 +01:00
Felix Fontein
ed48629399 Prepare 3.3.1 release. 2022-12-06 08:15:55 +01:00
Felix Fontein
e87b327764
Improve container detection. (#522) 2022-12-06 08:11:44 +01:00
Felix Fontein
ffff6b7e77 Release 3.3.0. 2022-12-03 21:15:34 +01:00