containers / containers/podman-compose

depends_on: does not check if service exists

Open
#1,123 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
the podman-compose starts a service even if the dependent service does not exist.

**To Reproduce**
Steps to reproduce the behavior:
```
cat /etc/redhat-release
Fedora release 40 (Forty)

cd /tmp
mkdir ./1

cat ./1.yml
services:
**service1**:
image: nginx
environment:
- PORT=3000
ports:
- "3000:3000"

**service2**:
image: nginx
environment:
- PORT=3001
ports:
- "3001:3001"
depends_on:
**serviceBLAH:**
condition: service_started

```

**Expected behavior**
I expected some sanity/validation check if the service in "depends" exists.

**Actual behavior**
service2 starts

**Output**

```
podman-compose -v
podman-compose version 1.2.0
podman version 5.3.1

...

```

**Environment:**
cat /etc/redhat-release
Fedora release 40 (Forty)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the missing-service case from the issue with podman-compose and trace the depends_on handling for the serviceBLAH entry. Add validation so a dependency that is not defined is rejected, then run the relevant existing compose tests or add coverage showing service2 does not start.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, python
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.