containers / containers/podman-compose

No support for multiple `--scale` flags

Open
#1,532 0 comments 0 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**
When doing
```
podman-compose up --scale x=2 --scale y=3
```
podman-compose ignores the first `--scale` and only parses the final `--scale flag`, correctly scaling y to 3, but x to whatever is defined in the compose.yml

**To Reproduce**
Steps to reproduce the behavior:
1. Content: Simple docker-compose.yml with two services in current working directory:
```yaml
services:
client:
image: alpine:3.23.5
command: ["sleep", "infinity"]
deploy:
mode: replicated
replicas: 1

bootstrap:
image: alpine:3.23.5
command: ["sleep", "infinity"]
deploy:
mode: replicated
replicas: 1
```
2. `podman-compose up -d --scale client=3 --scale bootstrap=4`

**Expected behavior**
Both --scale flags are parsed and client deploys with 3 replicas, and bootstrap 4 replicas.

**Actual behavior**
Only the final --scale flag is parsed, and client deploys with 1 replica, and bootstrap 4 replicas.

**Output**

```
$ podman-compose --version
podman-compose version 1.6.0
podman version 5.5.1

$ podman-compose up -d --scale client=3 --scale bootstrap=4
Resolved "alpine" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/alpine:3.23.5...
Getting image source signatures
Copying blob e6f31ffc071e done |
Copying config 0d3e09a185 done |
Writing manifest to image destination
bd65825c15bc7979563d47b18ced0e4e8962f3608f54697f2a1ca7d9d9a97a8b
3aab9fd993b664ca13306cc75a05fc3719fd2ba53037d6b1a2a9b50e80492313
9a5afed293241c1268f3bde4f95c1372622c96727606a715904d52c5cff3cf4d
f74cda8b1397d07381e811db3578a60f421be150a050e3afd1d9dcdaf81b6f85
9bbcc54df63344c430ee4f4cbddae04fcb240781aef28744699f6fff69eb674d
podman-compose_client_1
podman-compose_bootstrap_1
podman-compose_bootstrap_2
podman-compose_bootstrap_3
podman-compose_bootstrap_4
$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
99d05d29df98 docker.io/library/alpine:3.23.5 sleep infinity 6 seconds ago Up 5 seconds podman-compose_client_1
36a16ebbd511 docker.io/library/alpine:3.23.5 sleep infinity 6 seconds ago Up 5 seconds podman-compose_bootstrap_1
95d457783a16 docker.io/library/alpine:3.23.5 sleep infinity 6 seconds ago Up 4 seconds podman-compose_bootstrap_2
241640ca680c docker.io/library/alpine:3.23.5 sleep infinity 5 seconds ago Up 4 seconds podman-compose_bootstrap_3
77497a58f2d8 docker.io/library/alpine:3.23.5 sleep infinity 5 seconds ago Up 4 seconds podman-compose_bootstrap_4

```

**Environment:**
- OS: Linux
- podman version: 5.5.1
- podman compose version: 1.6.0: Commit SHA: 0f6537e9cfa38f6035ac57c1716b6d55dbaf3ca4

**Additional Notes**
Unrelated, I also noticed in the compose.yml, `deploy` requires `mode: replicated` in order to acknowledge the replicas set in the compose.yml. Else the number of replicas set is one. Is this intended? I noticed older versions of podman-compose didn't have this limitation (e.g., v1.0.6). If it's not intended behavior, I can create another issue to address that, as well.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported podman-compose up command with two --scale flags and inspect the CLI argument parsing path that handles --scale. Ensure the completed change preserves both service scale values, then verify that client reaches 3 replicas and bootstrap reaches 4 using the provided compose.yml scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.