mirror of
https://github.com/docker/compose.git
synced 2026-11-28 02:49:57 +00:00
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> |
||
|---|---|---|
| .. | ||
| plan.go | ||
| plan_test.go | ||