diff --git a/changelogs/fragments/1199-docker_image-push.yml b/changelogs/fragments/1199-docker_image-push.yml new file mode 100644 index 00000000..0fc67985 --- /dev/null +++ b/changelogs/fragments/1199-docker_image-push.yml @@ -0,0 +1,2 @@ +bugfixes: + - "docker_image, docker_image_push - adjust image push detection to Docker 29 (https://github.com/ansible-collections/community.docker/pull/1199)." diff --git a/plugins/modules/docker_image.py b/plugins/modules/docker_image.py index f0544cf5..77e18174 100644 --- a/plugins/modules/docker_image.py +++ b/plugins/modules/docker_image.py @@ -803,7 +803,7 @@ class ImageManager(DockerBaseClass): if line.get("errorDetail"): raise RuntimeError(line["errorDetail"]["message"]) status = line.get("status") - if status == "Pushing": + if status in ("Pushing", "Pushed"): changed = True self.results["changed"] = changed except Exception as exc: # pylint: disable=broad-exception-caught diff --git a/plugins/modules/docker_image_push.py b/plugins/modules/docker_image_push.py index 8d8100dd..4ad585b6 100644 --- a/plugins/modules/docker_image_push.py +++ b/plugins/modules/docker_image_push.py @@ -159,7 +159,7 @@ class ImagePusher(DockerBaseClass): if line.get("errorDetail"): raise RuntimeError(line["errorDetail"]["message"]) status = line.get("status") - if status == "Pushing": + if status in ("Pushing", "Pushed"): results["changed"] = True except Exception as exc: # pylint: disable=broad-exception-caught if "unauthorized" in str(exc):