Merge pull request #1208 from mokibit/reset-depends-on

Fix reset tag attribute to also reset `depends_on` parameter
This commit is contained in:
Povilas Kanapickas 2025-05-18 18:42:52 +03:00 committed by GitHub
commit bfaf77a506
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 0 deletions

View File

@ -1713,6 +1713,8 @@ def normalize_service(service, sub_dir=""):
if "depends_on" in service:
# deps should become a dictionary of dependencies
deps = service["depends_on"]
if isinstance(deps, ResetTag):
return service
if isinstance(deps, str):
deps = {deps: {}}
elif is_list(deps):

View File

@ -3,3 +3,4 @@ services:
app:
image: busybox
command: !reset {}
depends_on: !reset null

View File

@ -3,3 +3,5 @@ services:
app:
image: busybox
command: ["/bin/busybox", "echo", "Zero"]
depends_on:
- db

View File

@ -53,6 +53,8 @@ class TestComposeResetTagAttribute(unittest.TestCase, RunSubprocessMixin):
"logs",
])
self.assertEqual(output, b"")
# depends_on: !reset null testing: if this test works, depends_on is correctly reset.
# Otherwise the test would break, since "db" dependency service is not provided
finally:
self.run_subprocess_assert_returncode([
podman_compose_path(),