@@ -59,22 +59,22 @@ func newPsCommand(dockerCli command.Cli) *cobra.Command {
5959 return cmd
6060}
6161
62- func runPs (ctx context.Context , dockerCli command.Cli , options psOptions ) error {
63- client := dockerCli .Client ()
62+ func runPs (ctx context.Context , dockerCLI command.Cli , options psOptions ) error {
63+ apiClient := dockerCLI .Client ()
6464
6565 var (
6666 errs []string
6767 tasks []swarm.Task
6868 )
6969
7070 for _ , nodeID := range options .nodeIDs {
71- nodeRef , err := Reference (ctx , client , nodeID )
71+ nodeRef , err := Reference (ctx , apiClient , nodeID )
7272 if err != nil {
7373 errs = append (errs , err .Error ())
7474 continue
7575 }
7676
77- node , _ , err := client .NodeInspectWithRaw (ctx , nodeRef )
77+ node , _ , err := apiClient .NodeInspectWithRaw (ctx , nodeRef )
7878 if err != nil {
7979 errs = append (errs , err .Error ())
8080 continue
@@ -83,7 +83,7 @@ func runPs(ctx context.Context, dockerCli command.Cli, options psOptions) error
8383 filter := options .filter .Value ()
8484 filter .Add ("node" , node .ID )
8585
86- nodeTasks , err := client .TaskList (ctx , swarm.TaskListOptions {Filters : filter })
86+ nodeTasks , err := apiClient .TaskList (ctx , swarm.TaskListOptions {Filters : filter })
8787 if err != nil {
8888 errs = append (errs , err .Error ())
8989 continue
@@ -94,11 +94,11 @@ func runPs(ctx context.Context, dockerCli command.Cli, options psOptions) error
9494
9595 format := options .format
9696 if len (format ) == 0 {
97- format = task .DefaultFormat (dockerCli .ConfigFile (), options .quiet )
97+ format = task .DefaultFormat (dockerCLI .ConfigFile (), options .quiet )
9898 }
9999
100100 if len (errs ) == 0 || len (tasks ) != 0 {
101- if err := task .Print (ctx , dockerCli , tasks , idresolver .New (client , options .noResolve ), ! options .noTrunc , options .quiet , format ); err != nil {
101+ if err := task .Print (ctx , dockerCLI , tasks , idresolver .New (apiClient , options .noResolve ), ! options .noTrunc , options .quiet , format ); err != nil {
102102 errs = append (errs , err .Error ())
103103 }
104104 }
0 commit comments