mirror of
https://github.com/docker/compose.git
synced 2026-11-18 14:13:49 +00:00
Second Copilot review finding in the same vein as the previous network/volume fix: collectObservedState's mergeHookContainers call (getHookContainers, an extra ContainerList with a hook-specific label filter) is consumed exclusively by create-phase runner reconciliation (planPreStartHookRunners, reconcile.go) -- the start phase's own RunPreStart never reads observed.HookContainers at all; it executes a runner the create phase already prepared, or fails outright if none exists. Performing this query unconditionally meant a no-op `compose start` on a service declaring pre_start hooks could fail on a daemon call the old imperative engine never made. Gated behind the same scope.plansCreatePhase() check as the network/ volume listing. New regression test TestCollectObservedState_ScopeStartSkipsHookContainerQuery registers exactly one ContainerList expectation (the default Times(1)): gomock fails the test if the extra hook-container listing fires under ScopeStart. Verified by ablation (reverting the guard reproduces the failure deterministically, 3/3 runs). Verified: go build, go test ./pkg/compose/..., and golangci-lint all clean; full e2e suite re-run clean against a locally built binary (same 3 pre-existing, environment-specific failures as the stack's baseline: TestWatch, TestIPC, TestComposeModel). Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> |
||
|---|---|---|
| .. | ||
| api | ||
| bridge | ||
| compose | ||
| dryrun | ||
| e2e | ||
| mocks | ||
| remote | ||
| utils | ||
| watch | ||