-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compatibility for docker-py version 3 #36973
Conversation
The test
The test
|
(Squashed two commits down to one and rebased against current devel. Apologies for any confusion. I think I did it cleanly.) |
(cherry picked from commit d984afa)
What versions will this be available in? |
It's in devel (aka 2.6) and was also backported to 2.5. This PR covered 2.6, and #37071 covers 2.5. |
I've cherry-picked it to stable-2.4 as well. So the next releases to have it should be 2.5.0 and 2.4.4 |
SUMMARY
Adds decision trees in the container, image, and network docker modules to account for Docker SDK for Python changes made in version 3. Effectively adds Ansible support for the docker_ modules for Python 3.6 since Docker SDK 3 adds that support.
The SDK changes being fixed for comptatibility are specifically outlined at https://docker-py.readthedocs.io/en/stable/change-log.html#breaking-changes . I cannot guarantee I've fixed every incompatibility, but I'm fairly sure I've found at least "most" of them - and certainly this addresses more than current devel, which is "none of them". I tested creating images, pulling an image, pushing an image to a tar file, and running a container with and without detaching it, using (docker-py, docker < 3, and docker >= 3).
Fixes #35612 .
ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/docker_common.py
lib/ansible/modules/cloud/docker/docker_container.py
lib/ansible/modules/cloud/docker/docker_image.py
lib/ansible/modules/cloud/docker/docker_network.py
ANSIBLE VERSION
devel
(This may want to be backported to at least 2.5, which was separated from devel at about the same time that docker SDK 3 came out.)
ADDITIONAL INFORMATION
Credit to @sivel for early clues as to where to apply module fixes. I took those, modified, and applied more of them.