WithDryRun configure Compose to run without actually applying changes
(s *composeService)
| 162 | |
| 163 | // WithDryRun configure Compose to run without actually applying changes |
| 164 | func WithDryRun(s *composeService) error { |
| 165 | s.dryRun = true |
| 166 | cli, err := command.NewDockerCli() |
| 167 | if err != nil { |
| 168 | return err |
| 169 | } |
| 170 | |
| 171 | options := flags.NewClientOptions() |
| 172 | options.Context = s.dockerCli.CurrentContext() |
| 173 | err = cli.Initialize(options, command.WithInitializeClient(func(cli *command.DockerCli) (client.APIClient, error) { |
| 174 | return dryrun.NewDryRunClient(s.apiClient(), s.dockerCli) |
| 175 | })) |
| 176 | if err != nil { |
| 177 | return err |
| 178 | } |
| 179 | s.dockerCli = cli |
| 180 | return nil |
| 181 | } |
| 182 | |
| 183 | type Prompt func(message string, defaultValue bool) (bool, error) |
| 184 |
nothing calls this directly
no test coverage detected