compose/pkg
Nicolas De Loof c1b1739f1c fix(plan): run the pre_stop hooks as an operation of the plan
The stop of the reconciliation plan runs the pre_stop hooks itself, in the
executor, since docker/compose#14477, except the stop of a recreate: the
replacement is created under a temporary name before the old container is
stopped, and a failing hook would leave it behind for the next up to trip on.
So a container that `up` replaces still goes without its hooks.

The hooks are now an operation of the plan, RunPreStop, that the stop depends
on. Every stop the plan makes has it: a recreated container, a scale down, the
containers of a recreated network or volume, the dependents restarted with a
recreated dependency, a service that moves to a provider. A container that has
no process to run them in skips them and is stopped all the same, as for
restart and down; a hook that fails fails the plan and leaves the container
running. A container stopped for two reasons is stopped once, and its hooks
run once.

A recreation runs the hooks before it creates the replacement: one that fails
then leaves nothing behind, and no stop has to skip them any more.

The plans of services without pre_stop hooks are unchanged.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2026-11-27 14:08:01 +01:00
..
api fix(api): list every accepted value in InvalidOptionError 2026-11-27 10:12:06 +01:00
bridge refactor(compose): share the label filter builders 2026-10-29 11:59:43 +01:00
compose fix(plan): run the pre_stop hooks as an operation of the plan 2026-11-27 14:08:01 +01:00
dryrun feat(registry): use the Docker Desktop Hub session for Docker Hub credentials 2026-10-07 14:24:28 +02:00
mocks run: trigger a job through the engine like a service 2026-11-17 13:48:57 +01:00
remote feat(oci): directly load from cache if possible 2026-11-26 16:07:36 +01:00
utils fix: make e2e tests pass reliably locally with Docker Desktop 2026-05-18 10:55:41 +02:00
watch golangci-lint: enable perfsprint linter 2026-09-10 10:25:34 +02:00