containers / containers/podman-compose

Pod name in pod-args not work in compose file

Open
#1,359 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 the name of the pod to be created is specified in `pod_args` in a compose file, it is not used for association during container creation. Instead, the default name beginning with `pod_` is used, which obviously cannot be found because it does not exist.

**To Reproduce**
Steps to reproduce the behavior:
1. create a compose file with instructions for creating a pod with a specific name (see the compose file to the end of issue).
```yaml
...

x-podman:
in_pod: true
pod_args:
- --infra-name=cryptgeon_infra
- --publish=3016:8000
- --name=cryptgeon
```
2. execute the command `podman compose -f compose-example1.yaml up -d`

**Expected behavior**
Association of containers within the pod specified in `pod_args` and not to the pod with the default name, which obviously has not been created.
```bash
podman compose -f compose-example1.yaml up -d
>>>> Executing external compose provider "/usr/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<

8748b42514253c56102104f384b2277ea2c21f970169bd966e641ea83ce7a2d6
2bc7de0b617ceec37ae6def907fae988827d6bfc631a0238bb16464dba2495e5
2a080a7c9c9922ba38d28fdd01a54e9319dfbe0c3aeb88b48c4a0fc14cf7c846
cryptgeon_cache
cryptgeon_app
```

**Actual behavior**
The containers are not associated with the pod specified in the compose file but with the pod with the default name, which has not been created.
```bash
podman compose -f compose-example1.yaml up -d
>>>> Executing external compose provider "/usr/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<

4d6912087ebf4ddbfec2e5df1ad07899e4d47c64f3702cee00503f867214c97f
Error: no pod with name or ID pod_cryptgeon found: no such pod
Error: no pod with name or ID pod_cryptgeon found: no such pod
Error: no container with name or ID "cryptgeon_cache" found: no such container
```

**Environment:**
- OS: Linux debian 13.2
- podman version: 5.4.2
- podman compose version: 1.5.0 (shoud be f7eeda1 commit)

**Additional context**
Upload file makes error, so i write here the example compose file `compose-exampl1.yaml` to reproduce error
```yaml
services:
redis:
image: docker.io/redis:latest
container_name: cryptgeon_cache
network_mode: bridge
command: redis-server --save "" --appendonly no --maxmemory 1gb --maxmemory-policy allkeys-lru
tmpfs:
- /data

app:
image: docker.io/cupcakearmy/cryptgeon:latest
container_name: cryptgeon_app
network_mode: bridge
depends_on:
- redis
environment:
REDIS: redis://localhost
SIZE_LIMIT: 4 MiB

x-podman:
in_pod: true
pod_args:
- --infra-name=cryptgeon_infra
- --publish=3016:8000
- --name=cryptgeon
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.