Skeleton for dry-run under alpha command#10173
Conversation
Codecov ReportBase: 73.89% // Head: 73.89% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## v2 #10173 +/- ##
=======================================
Coverage 73.89% 73.89%
=======================================
Files 2 2
Lines 272 272
=======================================
Hits 201 201
Misses 60 60
Partials 11 11 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
| cli, err := command.NewDockerCli() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| err = cli.Initialize(flags.NewClientOptions(), command.WithInitializeClient(func(cli *command.DockerCli) (client.APIClient, error) { | ||
| dryRunClient := api.NewDryRunClient() | ||
| dryRunClient.WithAPIClient(s.apiClient()) | ||
| return dryRunClient, nil | ||
| })) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| s.dockerCli = cli |
There was a problem hiding this comment.
could make it simpler by making API client an attribute in composeService, initialize with dockerCli.Client() and override here with NewDryRunClient.
There was a problem hiding this comment.
Ok as we just discussed, I'll open a PR to remove the dockerCli attribute in composeService struct, this way we could be sure that the composeService.apiClient() will be used everywhere.
When merged, we'll be able to safely introduce a APIClient attribute to composeService and be sure we won't have multiple kind of APIClient calls (like service.dockerCli.client() used at many place in the source code)
There was a problem hiding this comment.
Ok after digging a little bit, the dockerCli attribute is used widely by the CLI APIs, so it seams safer to override the APIClient of the existing command.Cli
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
update documentation Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
What I did
Add a
dry-runcommand skeleton under alpha command to test and incrementally implement--dry-runflagRelated issue
https://docker.atlassian.net/browse/ENV-1
start of work for #1203
(not mandatory) A picture of a cute animal, if possible in relation to what you did
