cli/command: rename vars for consistency and prevent shadowing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -12,11 +12,11 @@ import (
|
||||
)
|
||||
|
||||
// RunPS is the swarm implementation of docker stack ps
|
||||
func RunPS(ctx context.Context, dockerCli command.Cli, opts options.PS) error {
|
||||
func RunPS(ctx context.Context, dockerCLI command.Cli, opts options.PS) error {
|
||||
filter := getStackFilterFromOpt(opts.Namespace, opts.Filter)
|
||||
|
||||
client := dockerCli.Client()
|
||||
tasks, err := client.TaskList(ctx, swarm.TaskListOptions{Filters: filter})
|
||||
apiClient := dockerCLI.Client()
|
||||
tasks, err := apiClient.TaskList(ctx, swarm.TaskListOptions{Filters: filter})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -27,8 +27,8 @@ func RunPS(ctx context.Context, dockerCli command.Cli, opts options.PS) error {
|
||||
|
||||
format := opts.Format
|
||||
if len(format) == 0 {
|
||||
format = task.DefaultFormat(dockerCli.ConfigFile(), opts.Quiet)
|
||||
format = task.DefaultFormat(dockerCLI.ConfigFile(), opts.Quiet)
|
||||
}
|
||||
|
||||
return task.Print(ctx, dockerCli, tasks, idresolver.New(client, opts.NoResolve), !opts.NoTrunc, opts.Quiet, format)
|
||||
return task.Print(ctx, dockerCLI, tasks, idresolver.New(apiClient, opts.NoResolve), !opts.NoTrunc, opts.Quiet, format)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user