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

@ -35,7 +35,7 @@ func NewImagesCommand(dockerCli command.Cli) *cobra.Command {
if len(args) > 0 {
options.matchName = args[0]
}
return runImages(dockerCli, options)
return runImages(cmd.Context(), dockerCli, options)
},
Annotations: map[string]string{
"category-top": "7",
@ -62,9 +62,7 @@ func newListCommand(dockerCli command.Cli) *cobra.Command {
return &cmd
}
func runImages(dockerCli command.Cli, options imagesOptions) error {
ctx := context.Background()
func runImages(ctx context.Context, dockerCli command.Cli, options imagesOptions) error {
filters := options.filter.Value()
if options.matchName != "" {
filters.Add("reference", options.matchName)