containers / containers/podman-compose

Changed network settings don't apply until forced pruning

Open
#1,194 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**

Define a network in docker-compose.yml file, then change one of its settings and restart.

After inspecting the results, it'll be visible that the changed network settings don't apply. This is in contrast to the behaviour of rest of the compose file where you immediately see the effects upon restart.

**To Reproduce**

1. Create the following `docker-compose.yml` file:
```yml
services:
cat:
image: registry.opensuse.org/opensuse/tumbleweed:latest
networks:
br:

networks:
br:
internal: true
```
2. Start the container and observe its `internal` setting:
```sh
podman-compose up
podman network inspect test_br | jq .[].internal # false
```
3. Change the network setting `internal` to `false`:
```yml
networks:
br:
internal: true
```
4. Restart:
```sh
podman-compose down --remove-orphans && podman-compose up --force-recreate -d
```
6. Verify the setting that it's not changed:
```sh
podman network inspect test_br | jq .[].internal # false
```

**Actual behaviour**

Network setting doesn't change. It'd be expected, similar to other elements, to change when the content of the .yml file is changed. This is not the case, even with `--remove-orphans` and `--force-recreate` applied. These two options shouldn't be necessary, either.

Currently, only pruning networks help to apply the settings.

**Environment:**
```
$ podman-compose version
podman-compose version 1.2.0
podman version 5.4.2
```

OS: Linux

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.