Skip to content

Commit

Permalink
Remove the new option.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Dec 14, 2024
1 parent 0570ab4 commit 55b59cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
6 changes: 2 additions & 4 deletions changelogs/fragments/1011-docker_compose_v2-build-changed.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
minor_changes:
- "docker_compose_v2 - add ``ignore_build_events`` option (default value ``true``) which allows to (not) ignore build events for change detection
(https://github.com/ansible-collections/community.docker/issues/1005, https://github.com/ansible-collections/community.docker/issues/pull/1011)."
bugfixes:
- "docker_compose_v2 - when using Compose 2.31.0 or newer, revert to the old behavior that image rebuilds, for example if ``rebuild=always``, only
result in ``changed`` if a container has been restarted
(https://github.com/ansible-collections/community.docker/issues/1005, https://github.com/ansible-collections/community.docker/issues/pull/1011)."
(https://github.com/ansible-collections/community.docker/issues/1005, https://github.com/ansible-collections/community.docker/issues/pull/1011,
https://github.com/ansible-collections/community.docker/pull/1012)."
13 changes: 1 addition & 12 deletions plugins/modules/docker_compose_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@
- When O(state) is V(present) or V(restarted), specify whether or not to include linked services.
type: bool
default: true
ignore_build_events:
description:
- Ignores image building events for change detection.
- If O(state=present) and O(ignore_build_events=true) and O(build=always), a rebuild that does
not trigger a container restart no longer results in RV(ignore:changed=true).
- Note that Docker Compose 2.31.0 is the first Compose 2.x version to emit build events.
For older versions, the behavior is always as if O(ignore_build_events=true).
type: bool
default: true
version_added: 4.2.0
recreate:
description:
- By default containers will be recreated when their configuration differs from the service definition.
Expand Down Expand Up @@ -443,7 +433,7 @@ def __init__(self, client):
self.dependencies = parameters['dependencies']
self.pull = parameters['pull']
self.build = parameters['build']
self.ignore_build_events = parameters['ignore_build_events']
self.ignore_build_events = True
self.recreate = parameters['recreate']
self.remove_images = parameters['remove_images']
self.remove_volumes = parameters['remove_volumes']
Expand Down Expand Up @@ -640,7 +630,6 @@ def main():
scale=dict(type='dict'),
wait=dict(type='bool', default=False),
wait_timeout=dict(type='int'),
ignore_build_events=dict(type='bool', default=True),
)
argspec_ex = common_compose_argspec_ex()
argument_spec.update(argspec_ex.pop('argspec'))
Expand Down
21 changes: 0 additions & 21 deletions tests/integration/targets/docker_compose_v2/tasks/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,6 @@
state: present
register: present_2

- name: Present (idempotent check, build=always, ignore_build_events=false)
docker_compose_v2:
project_src: '{{ project_src }}'
state: present
build: always
ignore_build_events: false
check_mode: true
register: present_3_check

- name: Present (idempotent, build=always, ignore_build_events=false)
docker_compose_v2:
project_src: '{{ project_src }}'
state: present
build: always
ignore_build_events: false
register: present_3

- name: Present (idempotent check, build=always, ignore_build_events=true)
docker_compose_v2:
project_src: '{{ project_src }}'
Expand Down Expand Up @@ -119,10 +102,6 @@
- present_2_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
- present_2 is not changed
- present_2.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
- present_3_check is changed
- present_3_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
- ((present_3 is changed) if docker_compose_version is version('2.31.0', '>=') else (present_3 is not changed))
- present_3.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
- present_4_check is changed
- present_4_check.warnings | default([]) | select('regex', ' Please report this at ') | length == 0
- present_4 is not changed
Expand Down

0 comments on commit 55b59cd

Please sign in to comment.