-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for conditional dependencies
Signed-off-by: Felix Rubio <felix@kngnt.org>
- Loading branch information
Showing
5 changed files
with
187 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added support for honoring the condition in the depends_on section of the service, if stated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/integration/deps/docker-compose-conditional-fails.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: "3.7" | ||
services: | ||
web: | ||
image: nopush/podman-compose-test | ||
command: ["dumb-init", "/bin/busybox", "httpd", "-f", "-h", "/etc/", "-p", "8000"] | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
healthcheck: | ||
test: ["CMD", "/bin/false"] | ||
interval: 10s # Time between health checks | ||
timeout: 1s # Time to wait for a response | ||
retries: 1 # Number of consecutive failures before marking as unhealthy | ||
sleep: | ||
image: nopush/podman-compose-test | ||
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 3600"] | ||
depends_on: | ||
web: | ||
condition: service_healthy | ||
tmpfs: | ||
- /run | ||
- /tmp |
22 changes: 22 additions & 0 deletions
22
tests/integration/deps/docker-compose-conditional-succeeds.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: "3.7" | ||
services: | ||
web: | ||
image: nopush/podman-compose-test | ||
command: ["dumb-init", "/bin/busybox", "httpd", "-f", "-h", "/etc/", "-p", "8000"] | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
healthcheck: | ||
test: ["CMD", "wget", "-qO-", "http://localhost:8000/hosts"] | ||
interval: 30s # Time between health checks | ||
timeout: 5s # Time to wait for a response | ||
retries: 3 # Number of consecutive failures before marking as unhealthy | ||
sleep: | ||
image: nopush/podman-compose-test | ||
command: ["dumb-init", "/bin/busybox", "sh", "-c", "sleep 3600"] | ||
depends_on: | ||
web: | ||
condition: service_healthy | ||
tmpfs: | ||
- /run | ||
- /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters