Skip to content

Commit 8566daa

Browse files
ndeloofglours
authored andcommitted
use recently introduced withSelectedServicesOnly to reduce code duplication
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 1b1f783 commit 8566daa

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cmd/compose/up.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,10 @@ type upOptions struct {
5555

5656
func (opts upOptions) apply(project *types.Project, services []string) error {
5757
if opts.noDeps {
58-
enabled, err := project.GetServices(services...)
58+
err := withSelectedServicesOnly(project, services)
5959
if err != nil {
6060
return err
6161
}
62-
for _, s := range project.Services {
63-
if !utils.StringContains(services, s.Name) {
64-
project.DisabledServices = append(project.DisabledServices, s)
65-
}
66-
}
67-
project.Services = enabled
6862
}
6963

7064
if opts.exitCodeFrom != "" {

0 commit comments

Comments
 (0)