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
@ -18,7 +18,7 @@ func newDisableCommand(dockerCli command.Cli) *cobra.Command {
|
||||
Short: "Disable a plugin",
|
||||
Args: cli.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return runDisable(dockerCli, args[0], force)
|
||||
return runDisable(cmd.Context(), dockerCli, args[0], force)
|
||||
},
|
||||
}
|
||||
|
||||
@ -27,8 +27,8 @@ func newDisableCommand(dockerCli command.Cli) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func runDisable(dockerCli command.Cli, name string, force bool) error {
|
||||
if err := dockerCli.Client().PluginDisable(context.Background(), name, types.PluginDisableOptions{Force: force}); err != nil {
|
||||
func runDisable(ctx context.Context, dockerCli command.Cli, name string, force bool) error {
|
||||
if err := dockerCli.Client().PluginDisable(ctx, name, types.PluginDisableOptions{Force: force}); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(dockerCli.Out(), name)
|
||||
|
||||
Reference in New Issue
Block a user