From 197e6352c64a093f23b22cc3490312f71535aaaf Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 16 May 2024 15:55:32 +0200 Subject: [PATCH] Fix deadlock in WithServicesTransform Signed-off-by: Nicolas De Loof --- types/project.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/project.go b/types/project.go index b86a563f..6f049e98 100644 --- a/types/project.go +++ b/types/project.go @@ -659,12 +659,12 @@ func (p *Project) WithServicesTransform(fn func(name string, s ServiceConfig) (S name string service ServiceConfig } - resultCh := make(chan result) + expect := len(p.Services) + resultCh := make(chan result, expect) newProject := p.deepCopy() eg, ctx := errgroup.WithContext(context.Background()) eg.Go(func() error { - expect := len(newProject.Services) s := Services{} for expect > 0 { select {