Skip to content

fix(reconcile): preserve zero-replica services during hashing#13931

Open
junhaoliao wants to merge 1 commit into
docker:mainfrom
junhaoliao:feat/preserve-zero-replica-services
Open

fix(reconcile): preserve zero-replica services during hashing#13931
junhaoliao wants to merge 1 commit into
docker:mainfrom
junhaoliao:feat/preserve-zero-replica-services

Conversation

@junhaoliao

@junhaoliao junhaoliao commented Jul 9, 2026

Copy link
Copy Markdown

What I did

Prevent ServiceHash from mutating the caller's DeployConfig when excluding deploy.replicas from the service hash. This preserves deploy.replicas: 0 through reconciliation so docker compose up continues to skip zero-replica dependencies instead of waiting for a missing container.

Added a focused regression test that hashes a zero-replica dependency before running dependency-wait logic and verifies the dependency is still skipped.

Related issue

Fixes #13899.

Validation

gofmt -w pkg/compose/hash.go pkg/compose/convergence_test.go

No stdout/stderr.

go test ./pkg/compose -run 'TestServiceHash|TestWaitDependencies' -count=1

ok  	github.com/docker/compose/v5/pkg/compose	0.008s

go test ./pkg/compose -count=1

ok  	github.com/docker/compose/v5/pkg/compose	0.146s

go vet ./pkg/compose

No stdout/stderr.

go build -tags e2e -o /tmp/docker-compose-pr-build ./cmd

No stdout/stderr.

git diff --check

No stdout/stderr.

Signed-off-by: Junhao Liao <junhao@junhao.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Services with zero replicas fail to start when they have a dependency that has zero replicas

1 participant