Commit Graph

561 Commits

Author SHA1 Message Date
Felix Fontein dd19db8c8f Normalize bools in tests. (#589) 2023-02-15 22:29:41 +01:00
Felix Fontein a426232523 Fix imports. (#585) 2023-02-12 22:09:02 +01:00
Felix Fontein 449b91d489 Remove unnecessary test imports. (#583) 2023-02-12 20:59:51 +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 https://github.com/docker/docker-py/commit/34e6829dd40e99e9ba47ea02fcfabda09e08d36e

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 eb186f0098 Restrict regular CI runs on old branches to stable-2. 2023-02-06 09:28:15 +01:00
Felix Fontein 3a1bfc4be2 CI: Make tests work with Docker API version 1.42 (#576)
* Make tests work with API version 1.42.

* Make sure anonymous volume is separated from container a bit earlier.

* Another try.
2023-02-04 22:16:25 +01:00
Felix Fontein 421bae419d Improve current_container_facts docs (#574)
* Improve current_container_facts docs.

* [TEMP] Run current_container_facts module in CI outside of ansible-test.

* Revert "[TEMP] Run current_container_facts module in CI outside of ansible-test."

This reverts commit 1cdd3e3550.

* Describe current state of return values.
2023-02-03 17:13:31 +01:00
Felix Fontein 0e1152a630 Use branch from https://github.com/ansible-community/github-docs-build/pull/67. 2023-02-03 15:37:02 +01:00
Felix Fontein d57b26269a Looks like BuilderSize was never documented and eventually got removed. Replace with something that is documented (https://docs.docker.com/engine/api/v1.42/#tag/System/operation/SystemDataUsage). (#569) 2023-02-03 11:33:29 +01:00
Felix Fontein a78bd6f443 Fix check in SSH connection test (#567)
* Fix check.

* Adjust error check.
2023-01-22 19:11:52 +00:00
Felix Fontein c0d9ca67c4 Restrict to old enough paramiko on RHEL 8 or other systems using Python 3.6. (#563) 2023-01-22 17:15:27 +01:00
David Jack Wange Olrik c24ea78f6e docs: Fix json path in asserts (#560)
##### SUMMARY

The current path to the running state does not include `output.services.` which it should.

##### ISSUE TYPE

- Docs Pull Request

+label: docsite_pr
2023-01-20 13:19:33 +01:00
Felix Fontein dc611a05d1 Next expected release is 3.5.0. 2023-01-14 11:47:49 +01:00
Felix Fontein 96b6f5917d Release 3.4.0. 3.4.0 2023-01-14 11:20:16 +01:00
Felix Fontein b114d451fd Forgot to add version_added. 2023-01-14 11:19:42 +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 01429108d3 Use stable-2.x branches from my work to get the patch from https://github.com/ansible/ansible/pull/79734. 2023-01-13 20:30:02 +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 134d32cae6 CI: improve Docker setup (#550)
* Cache has already been updated a few lines before.

* When skipping Docker cleanup, create flag to avoid the expensive part of the setup (including package manager cache update) to be run again.
2023-01-08 22:21:59 +01:00
Felix Fontein dc5af8985b Update CI matrix. (#549) 2023-01-07 11:25:10 +01:00
Felix Fontein 18091193de Fix error handling. (#546) 2023-01-05 09:42:42 +01:00
Felix Fontein 311926aaad Forgot to switch docs fragment for docker_container: it no longer depends on the Docker SDK for Python. (#544) 2023-01-01 21:54:35 +01:00
Felix Fontein 3470e5effb Add setup role for Docker Compose v2. (#542) 2022-12-30 15:19:20 +01:00
Felix Fontein c6aca384ed Delete stopped container as well. 2022-12-28 16:33:45 +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 44b98609fd CI: add CentOS Stream 8 with Python 3.6 to matrix (#531)
* Add more VMs.

* Disable corresponding docker containers.

* Remove VMs.
2022-12-20 22:57:21 +01:00
Felix Fontein 839ad6086e Improve docsite build. 2022-12-18 21:50:41 +01:00
Felix Fontein f3e77c193d Switch to my fork of ansible-test-gh-action. 2022-12-18 09:54:09 +01:00
Felix Fontein 5cb24d2e69 The ansible-test patch has been backported to stable-2.12. 2022-12-17 19:39:36 +01:00
Mark Mercado cc9191f8cb Fix the collection name (#532) 2022-12-14 07:45:21 +01:00
Felix Fontein b6034929bd Fix CI names. 2022-12-12 21:27:07 +01:00
Felix Fontein 02915cd22c Improve CI (#528)
* Update CI scripts to be more close to the ones in ansible-core.

* Extend CI matrix.

* Make sure that docker daemon is running (when not in a container).

* Make sure that connection plugin tests do not uninstall Docker daemon.

* Check some conditions.

* Fix error ignores.

* Skip SSH test on Alpine VMs.

* Take care of more errors.

* Adjust for more errors.

* Improve conditions.

* Remove new entries from CI matrix; make CI matrix nicer.
2022-12-11 17:30:37 +01:00
Felix Fontein 7e213200ce Next expected release is 3.4.0. 2022-12-09 21:46:55 +01:00
Felix Fontein b8fb4740a3 Release 3.3.2. 3.3.2 2022-12-09 21:27:38 +01:00
Felix Fontein 970b95e3fa Bump CentOS Stream 8 Python from 3.8 to 3.9. (#529) 2022-12-09 14:58:00 +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 b318c02148 Allow triggering docs workflow manually. 2022-12-07 19:54:23 +01:00
Felix Fontein f823555ae3 Backports to stable-2.13 and stable-2.14 have been merged. (#525)
https://github.com/ansible/ansible/pull/79538
https://github.com/ansible/ansible/pull/79507
2022-12-07 08:58:58 +01:00
Felix Fontein 13968bda22 Next expected release is 3.4.0. 2022-12-06 13:55:14 +01:00
Felix Fontein 080a043c79 Release 3.3.1. 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 3ed7c56704 The next expected release is 3.4.0. 2022-12-03 21:40:51 +01:00
Felix Fontein ffff6b7e77 Release 3.3.0. 3.3.0 2022-12-03 21:15:34 +01:00