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:
committed by
Sebastiaan van Stijn
parent
9eb632dc7c
commit
5400a48aaf
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user