report error when there's no container to start

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-07-12 12:10:50 +02:00
parent 396d449d36
commit 0a5b43d1e3
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 4 additions and 0 deletions

View File

@ -556,6 +556,10 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
return err
}
if len(containers) == 0 {
return fmt.Errorf("no containers to start")
}
w := progress.ContextWriter(ctx)
eg, ctx := errgroup.WithContext(ctx)
for _, container := range containers {