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
@ -26,7 +26,7 @@ func newScaleCommand(dockerCli command.Cli) *cobra.Command {
|
||||
Short: "Scale one or multiple replicated services",
|
||||
Args: scaleArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return runScale(dockerCli, options, args)
|
||||
return runScale(cmd.Context(), dockerCli, options, args)
|
||||
},
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return CompletionFn(dockerCli)(cmd, args, toComplete)
|
||||
@ -56,10 +56,9 @@ func scaleArgs(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func runScale(dockerCli command.Cli, options *scaleOptions, args []string) error {
|
||||
func runScale(ctx context.Context, dockerCli command.Cli, options *scaleOptions, args []string) error {
|
||||
var errs []string
|
||||
var serviceIDs []string
|
||||
ctx := context.Background()
|
||||
|
||||
for _, arg := range args {
|
||||
serviceID, scaleStr, _ := strings.Cut(arg, "=")
|
||||
|
||||
Reference in New Issue
Block a user