mirror of
https://github.com/docker/compose.git
synced 2026-11-17 13:45:39 +00:00
A provider's relay is a singleton network stand-in, never itself a replica: reconcileService's provider branch always plans exactly one OpRunProvider node, regardless of the scale requested through `compose scale` or `scale:`. That value is neither rejected nor acted on by Compose -- it is already passed through unmodified as part of the full service config a provider receives over its control channel (GetServiceConfigType marshals the whole resolved ServiceConfig). Interpreting it -- scaling the real resource the provider manages, ignoring it, or rejecting it itself -- is entirely the provider's own call. The example provider used by the e2e suite is extended to read that response into the real types.ServiceConfig (the same struct Compose marshaled) and call GetScale() on it -- the canonical accessor, which already reconciles the scale: and deploy.replicas: spellings -- then surfaces the result as CONFIG_SCALE, exercising the path end to end the same way it already does for CONFIG_TYPE. Two regression tests: - TestReconcileService_ProviderScaleNeverMultipliesTheRelay locks the plan-level invariant: a declared scale of 3 still produces exactly one OpRunProvider node. - TestProviderScaleReachesTheProvider (e2e) locks the value actually reaching the provider through a real daemon, that `compose scale` itself converges without error on a provider-backed service, and that the relay stays a single container across two different scale requests. Verified: go build, go test ./pkg/compose/..., and golangci-lint all clean; the full provider e2e subset re-run clean against a locally built binary. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com> |
||
|---|---|---|
| .. | ||
| examples | ||
| reference | ||
| yaml/main | ||
| extension.md | ||
| sdk.md | ||