mirror of
https://github.com/docker/cli.git
synced 2026-09-24 15:30:10 -05:00
feat: use main func ctx for cobra and use ctx in tests
Explicitly create the context and set it on the CLI, instead of depending on NewDockerCli() to instance a default context. Co-authored-by: Sebastiaan van Stijn <github@gone.nl> Co-authored-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
co-authored by
Alano Terblanche
parent
865190615b
commit
86162f7816
@@ -37,6 +37,7 @@ func gen(opts *options) error {
|
||||
Use: "docker [OPTIONS] COMMAND [ARG...]",
|
||||
Short: "The base command for the Docker CLI.",
|
||||
}
|
||||
|
||||
clientOpts, _ := cli.SetupRootCommand(cmd)
|
||||
if err := dockerCLI.Initialize(clientOpts); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user