Skip to content

No support for multiple --scale flags #1532

Description

@Naapple

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:
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
  1. 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: 0f6537e

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions