mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Revert "Apply newly loaded envvars to DockerCli
and APIClient
" (#9792)
Revert "Merge pull request #9745 from ulyssessouza/apply-newly-loaded-envvars" This reverts commit 6fe34c45cad8790da99f195f3269eca0e8f0fc0b, reversing changes made to 10cfd551e3f1e6428dbcf16f480a1fdbaaf92986. Signed-off-by: Milas Bowman <milas.bowman@docker.com>
This commit is contained in:
parent
88406491c9
commit
f3e0c386d2
@ -32,8 +32,6 @@ import (
|
||||
dockercli "github.com/docker/cli/cli"
|
||||
"github.com/docker/cli/cli-plugins/manager"
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/flags"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/morikuni/aec"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -293,18 +291,6 @@ func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Reset DockerCli and APIClient to get possible `DOCKER_HOST` and/or `DOCKER_CONTEXT` loaded from environment file.
|
||||
err = dockerCli.Apply(func(cli *command.DockerCli) error {
|
||||
return cli.Initialize(flags.NewClientOptions(),
|
||||
command.WithInitializeClient(func(_ *command.DockerCli) (client.APIClient, error) {
|
||||
return nil, nil
|
||||
}))
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
parent := cmd.Root()
|
||||
if parent != nil {
|
||||
parentPrerun := parent.PersistentPreRunE
|
||||
|
Loading…
x
Reference in New Issue
Block a user