Browse Source

report error when there's no container to start

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 4 năm trước cách đây
mục cha
commit
0a5b43d1e3
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      pkg/compose/convergence.go

+ 4 - 0
pkg/compose/convergence.go

@@ -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 {