Skip to content

Commit

Permalink
Imporve parsing of skipped messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jul 6, 2024
1 parent bbf163e commit 47c96a5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/916-compose-v2-parse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "docker_compose_v2* modules - fix parsing of skipped pull messages for Docker Compose 2.28.x (https://github.com/ansible-collections/community.docker/issues/911, https://github.com/ansible-collections/community.docker/pull/916)."
4 changes: 2 additions & 2 deletions plugins/module_utils/compose_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def from_docker_compose_event(cls, resource_type):
r'\s*'
r'(?P<resource_id>\S+)'
r'\s+'
r'Skipped -'
r'Skipped(?: -'
r'\s*'
r'(?P<msg>\S(?:|.*\S))'
r'(?P<msg>\S(?:|.*\S))|\s*)'
r'$'
)

Expand Down
30 changes: 30 additions & 0 deletions tests/unit/plugins/module_utils/test_compose_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,36 @@
'dummy4: Foo bar',
],
),
(
# https://github.com/ansible-collections/community.docker/issues/911
'2.28.1-image-pull-skipped',
'2.28.1',
False,
" bash_1 Skipped \n"
" bash_2 Pulling \n"
" bash_2 Pulled \n",
[
Event(
'unknown',
'bash_1',
'Skipped',
None,
),
Event(
'service',
'bash_2',
'Pulling',
None,
),
Event(
'service',
'bash_2',
'Pulled',
None,
),
],
[],
),
]

_ALL_TEST_CASES = EVENT_TEST_CASES + EXTRA_TEST_CASES
Expand Down

0 comments on commit 47c96a5

Please sign in to comment.