mirror of https://github.com/docker/compose.git
use recently introduced `withSelectedServicesOnly` to reduce code duplication
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
1b1f783e99
commit
8566daa96e
|
@ -55,16 +55,10 @@ type upOptions struct {
|
||||||
|
|
||||||
func (opts upOptions) apply(project *types.Project, services []string) error {
|
func (opts upOptions) apply(project *types.Project, services []string) error {
|
||||||
if opts.noDeps {
|
if opts.noDeps {
|
||||||
enabled, err := project.GetServices(services...)
|
err := withSelectedServicesOnly(project, services)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, s := range project.Services {
|
|
||||||
if !utils.StringContains(services, s.Name) {
|
|
||||||
project.DisabledServices = append(project.DisabledServices, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
project.Services = enabled
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.exitCodeFrom != "" {
|
if opts.exitCodeFrom != "" {
|
||||||
|
|
Loading…
Reference in New Issue