mirror of https://github.com/docker/compose.git
don't use unitialized cli to setup DryRunClient
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
b1334b8dfc
commit
b5f5e27597
|
@ -70,7 +70,7 @@ type execDetails struct {
|
|||
}
|
||||
|
||||
// NewDryRunClient produces a DryRunClient
|
||||
func NewDryRunClient(apiClient client.APIClient, cli *command.DockerCli) (*DryRunClient, error) {
|
||||
func NewDryRunClient(apiClient client.APIClient, cli command.Cli) (*DryRunClient, error) {
|
||||
b, err := builder.New(cli, builder.WithSkippedValidation())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -88,8 +88,11 @@ func (s *composeService) DryRunMode(ctx context.Context, dryRun bool) (context.C
|
|||
if err != nil {
|
||||
return ctx, err
|
||||
}
|
||||
err = cli.Initialize(flags.NewClientOptions(), command.WithInitializeClient(func(cli *command.DockerCli) (client.APIClient, error) {
|
||||
return api.NewDryRunClient(s.apiClient(), cli)
|
||||
|
||||
options := flags.NewClientOptions()
|
||||
options.Context = s.dockerCli.CurrentContext()
|
||||
err = cli.Initialize(options, command.WithInitializeClient(func(cli *command.DockerCli) (client.APIClient, error) {
|
||||
return api.NewDryRunClient(s.apiClient(), s.dockerCli)
|
||||
}))
|
||||
if err != nil {
|
||||
return ctx, err
|
||||
|
|
Loading…
Reference in New Issue