compose/internal/e2e/testdata/TestUpStartsCreatedContainerWithoutRecreatingIt
Nicolas De Loof d8cf81d432 fix(up): recreate a stopped container whose network was removed
A stopped container still refers to the networks it was attached to. When
one of them was removed, up created the network again but started the old
container, and the engine refused: "network <id> not found".

The network check of mustRecreate only ran for running containers, so a
stopped one was never compared with the network of the project. It now runs
whatever the state of the container, like the check of the volumes.

A network that no longer exists is not in the observed state, so a container
attached to a network of that name refers to the removed one and is
recreated. A container that was created but never started has no network ID
yet: it is left alone, rather than taken for one attached to another network.

Fixes #14516

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-11-17 09:14:22 +01:00
..
compose.yaml fix(up): recreate a stopped container whose network was removed 2026-11-17 09:14:22 +01:00