containers / containers/podman-compose

Podman Autoupdate does not work with podman-compose systemd generated pods/containers

Open
#534 13 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

Using the devel branch (acquired 2022-07-28) pods/containers that have the appropriate `"io.containers.autoupdate=registry"` labels fail to update with an error saying `auto-updating container "LONG_HASH_HERE": no PODMAN_SYSTEMD_UNIT` label found

**To Reproduce**
Steps to reproduce the behavior:
1. Ensure the relevent containers have the`io.containers.autoupdate=registry` label in the compose file.
2. Run `sudo podman-compose systemd --action create-unit`
3. Run `podman-compose systemd -a register -f myfile.yml`
4. Run `systemctl --user enable --now 'podman-compose@myfile'`
5. Run `podman auto-update`

**Expected behavior**
Updated imaged are pulled, and the pods relaunched with appropriate new images

**Actual behavior**
An error happens.

**Output**

```
$ podman-compose --version
podman-compose version: 1.0.4
['podman', '--version', '']
using podman version: 4.1.1
podman-compose version 1.0.4
podman --version
podman version 4.1.1
exit code: 0

$ podman auto-update
Error: 2 errors occurred:
* auto-updating container "LONG_HASH": no PODMAN_SYSTEMD_UNIT label found
* auto-updating container "LONG_HASH": no PODMAN_SYSTEMD_UNIT label found

```

**Additional context**

I was able to fix this by adding an additional `PODMAN_SYSTEMD_UNIT` label to the compose file (in the compose file below), but shoulden’t this be applied via the env file or somewhere else?

```yml
version: "3"

networks:
gitea:
external: false

services:
server:
labels:
- "io.containers.autoupdate=registry"
- "PODMAN_SYSTEMD_UNIT=podman-compose@gitea.service"
image: gitea/gitea:1
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
- DB_TYPE=postgres
- DB_HOST=db:5432
- DB_NAME=
- DB_USER=
- DB_PASSWD=
restart: always
networks:
- gitea
volumes:
- /opt/gitea/gitea:/data
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "22:22"
depends_on:
- db
db:
labels:
- "io.containers.autoupdate=registry"
- "PODMAN_SYSTEMD_UNIT=podman-compose@gitea.service"
image: postgres:14-alpine
restart: always
environment:
- POSTGRES_USER=
- POSTGRES_PASSWORD=
- POSTGRES_DB=
networks:
- gitea
volumes:
- /opt/gitea/postgres:/var/lib/postgresql/data
```

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.