Skip to content

Commit 7cf5940

Browse files
authored
Merge pull request docker#10035 from ndeloof/9323
use StringToBool to detect COMPOSE_IGNORE_ORPHANS
2 parents 2e7644f + 7369127 commit 7cf5940

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/compose/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/docker/cli/cli"
3333
"github.com/docker/compose/v2/pkg/api"
3434
"github.com/docker/compose/v2/pkg/progress"
35+
"github.com/docker/compose/v2/pkg/utils"
3536
)
3637

3738
type runOptions struct {
@@ -140,8 +141,7 @@ func runCommand(p *projectOptions, dockerCli command.Cli, backend api.Service) *
140141
if err != nil {
141142
return err
142143
}
143-
ignore := project.Environment["COMPOSE_IGNORE_ORPHANS"]
144-
opts.ignoreOrphans = strings.ToLower(ignore) == "true"
144+
opts.ignoreOrphans = utils.StringToBool(project.Environment["COMPOSE_IGNORE_ORPHANS"])
145145
return runRun(ctx, backend, project, opts, createOpts)
146146
}),
147147
ValidArgsFunction: completeServiceNames(p),

0 commit comments

Comments
 (0)