mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
added scale to toProjectName
Signed-off-by: Mehrad Dadar <mehrad.dadar@gmail.com>
This commit is contained in:
parent
5885a250bc
commit
32d44dfc25
@ -101,17 +101,19 @@ func (s *composeService) projectFromName(containers Containers, projectName stri
|
||||
if len(containers) == 0 {
|
||||
return project
|
||||
}
|
||||
set := map[string]moby.Container{}
|
||||
set := map[string]types.ServiceConfig{}
|
||||
for _, c := range containers {
|
||||
set[c.Labels[api.ServiceLabel]] = c
|
||||
}
|
||||
for s, c := range set {
|
||||
service := types.ServiceConfig{
|
||||
Name: s,
|
||||
sc := types.ServiceConfig{
|
||||
Name: c.Labels[api.ServiceLabel],
|
||||
Image: c.Image,
|
||||
Labels: c.Labels,
|
||||
}
|
||||
dependencies := c.Labels[api.DependenciesLabel]
|
||||
sc.Scale += 1
|
||||
set[sc.Name] = sc
|
||||
|
||||
}
|
||||
for _, service := range set {
|
||||
dependencies := service.Labels[api.DependenciesLabel]
|
||||
if len(dependencies) > 0 {
|
||||
service.DependsOn = types.DependsOnConfig{}
|
||||
for _, dc := range strings.Split(dependencies, ",") {
|
||||
|
@ -21,7 +21,6 @@ import (
|
||||
|
||||
"github.com/docker/compose/v2/pkg/api"
|
||||
"github.com/docker/compose/v2/pkg/progress"
|
||||
//"github.com/compose-spec/compose-go/types"
|
||||
)
|
||||
|
||||
func (s *composeService) Stop(ctx context.Context, projectName string, options api.StopOptions) error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user