mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
A provider that stops publishing endpoints on a later `up` left its previously created relay running: deployRelay was only evaluated when endpoints were non-empty, so a zero-endpoint up fell through with no cleanup. The generic reconciler is no help either — it returns early for any service.Provider != nil, before the recreate logic that would otherwise catch this. runPlugin now removes any existing relay when a provider publishes no endpoint on an up, whether it never did or stopped doing so since a previous run. Separately, startServiceContainer and restartContainer had no relay-awareness at all, unlike exec/cp which already refuse to target one via checkRelayTarget. A relay is a shell-less, FROM-scratch binary standing in for the service on the network: it has no filesystem or process for secrets/configs injection or PreStart/PostStart/PreStop hooks to act on. Nothing in the compose-spec schema forbids declaring secrets, configs or hooks on a provider: service, so this was reachable in practice, not just in theory. Both now skip those steps for a relay container while still starting/restarting the container itself normally. Co-Authored-By: Claude Sonnet 5 <[email protected]> Signed-off-by: Nicolas De Loof <[email protected]>