mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-31 23:45:51 +02:00
Merge pull request #1208 from mokibit/reset-depends-on
Fix reset tag attribute to also reset `depends_on` parameter
This commit is contained in:
commit
bfaf77a506
@ -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):
|
||||
|
@ -3,3 +3,4 @@ services:
|
||||
app:
|
||||
image: busybox
|
||||
command: !reset {}
|
||||
depends_on: !reset null
|
||||
|
@ -3,3 +3,5 @@ services:
|
||||
app:
|
||||
image: busybox
|
||||
command: ["/bin/busybox", "echo", "Zero"]
|
||||
depends_on:
|
||||
- db
|
||||
|
@ -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(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user