Plumb contexts through commands

This is to prepare for otel support.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Brian Goff
2023-09-09 22:27:44 +00:00
committed by Sebastiaan van Stijn
parent 9eb632dc7c
commit 5400a48aaf
146 changed files with 409 additions and 470 deletions

View File

@ -31,7 +31,7 @@ func newListCommand(dockerCLI command.Cli) *cobra.Command {
Short: "List services",
Args: cli.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return runList(dockerCLI, options)
return runList(cmd.Context(), dockerCLI, options)
},
ValidArgsFunction: completion.NoComplete,
}
@ -44,10 +44,9 @@ func newListCommand(dockerCLI command.Cli) *cobra.Command {
return cmd
}
func runList(dockerCLI command.Cli, options listOptions) error {
func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) error {
var (
apiClient = dockerCLI.Client()
ctx = context.Background()
err error
)