浏览代码

report error when there's no container to start

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 4 年之前
父节点
当前提交
0a5b43d1e3
共有 1 个文件被更改,包括 4 次插入0 次删除
  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 {