@@ -72,12 +72,12 @@ func NewAttachCommand(dockerCli command.Cli) *cobra.Command {
7272
7373func runAttach (dockerCli command.Cli , opts * attachOptions ) error {
7474 ctx := context .Background ()
75- client := dockerCli .Client ()
75+ apiClient := dockerCli .Client ()
7676
7777 // request channel to wait for client
78- resultC , errC := client .ContainerWait (ctx , opts .container , "" )
78+ resultC , errC := apiClient .ContainerWait (ctx , opts .container , "" )
7979
80- c , err := inspectContainerAndCheckState (ctx , client , opts .container )
80+ c , err := inspectContainerAndCheckState (ctx , apiClient , opts .container )
8181 if err != nil {
8282 return err
8383 }
@@ -109,7 +109,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
109109 defer signal .StopCatch (sigc )
110110 }
111111
112- resp , errAttach := client .ContainerAttach (ctx , opts .container , options )
112+ resp , errAttach := apiClient .ContainerAttach (ctx , opts .container , options )
113113 if errAttach != nil {
114114 return errAttach
115115 }
@@ -123,7 +123,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
123123 // the container and not exit.
124124 //
125125 // Recheck the container's state to avoid attach block.
126- _ , err = inspectContainerAndCheckState (ctx , client , opts .container )
126+ _ , err = inspectContainerAndCheckState (ctx , apiClient , opts .container )
127127 if err != nil {
128128 return err
129129 }
0 commit comments