Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit b9f38fe

Browse files
authored
Merge pull request #1935 from shua/scale0
2 parents 3d83989 + c82dd55 commit b9f38fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/compose/convergence.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ var mu sync.Mutex
111111
// updateProject updates project after service converged, so dependent services relying on `service:xx` can refer to actual containers.
112112
func (c *convergence) updateProject(project *types.Project, service string) {
113113
containers := c.getObservedState(service)
114+
if len(containers) == 0 {
115+
return
116+
}
114117
container := containers[0]
115118

116119
// operation is protected by a Mutex so that we can safely update project.Services while running concurrent convergence on services
@@ -557,6 +560,9 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
557560
}
558561

559562
if len(containers) == 0 {
563+
if scale, err := getScale(service); err != nil && scale == 0 {
564+
return nil
565+
}
560566
return fmt.Errorf("no containers to start")
561567
}
562568

0 commit comments

Comments
 (0)