MCPcopy
hub / github.com/docker/compose / WithDryRun

Function WithDryRun

pkg/compose/compose.go:164–181  ·  view source on GitHub ↗

WithDryRun configure Compose to run without actually applying changes

(s *composeService)

Source from the content-addressed store, hash-verified

162
163// WithDryRun configure Compose to run without actually applying changes
164func 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
183type Prompt func(message string, defaultValue bool) (bool, error)
184

Callers

nothing calls this directly

Calls 3

NewDryRunClientFunction · 0.92
apiClientMethod · 0.80
CurrentContextMethod · 0.65

Tested by

no test coverage detected