mirror of https://github.com/docker/compose.git
Merge pull request #10035 from ndeloof/9323
use StringToBool to detect COMPOSE_IGNORE_ORPHANS
This commit is contained in:
commit
7cf5940f4a
|
@ -32,6 +32,7 @@ import (
|
||||||
"github.com/docker/cli/cli"
|
"github.com/docker/cli/cli"
|
||||||
"github.com/docker/compose/v2/pkg/api"
|
"github.com/docker/compose/v2/pkg/api"
|
||||||
"github.com/docker/compose/v2/pkg/progress"
|
"github.com/docker/compose/v2/pkg/progress"
|
||||||
|
"github.com/docker/compose/v2/pkg/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type runOptions struct {
|
type runOptions struct {
|
||||||
|
@ -140,8 +141,7 @@ func runCommand(p *projectOptions, dockerCli command.Cli, backend api.Service) *
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
ignore := project.Environment["COMPOSE_IGNORE_ORPHANS"]
|
opts.ignoreOrphans = utils.StringToBool(project.Environment["COMPOSE_IGNORE_ORPHANS"])
|
||||||
opts.ignoreOrphans = strings.ToLower(ignore) == "true"
|
|
||||||
return runRun(ctx, backend, project, opts, createOpts)
|
return runRun(ctx, backend, project, opts, createOpts)
|
||||||
}),
|
}),
|
||||||
ValidArgsFunction: completeServiceNames(p),
|
ValidArgsFunction: completeServiceNames(p),
|
||||||
|
|
Loading…
Reference in New Issue