cli/command/container: attach: rename var that collided with import

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-06-08 15:23:26 +02:00
parent 1db37a881a
commit 0c5adb2e98
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 5 additions and 5 deletions

View File

@ -72,12 +72,12 @@ func NewAttachCommand(dockerCli command.Cli) *cobra.Command {
func runAttach(dockerCli command.Cli, opts *attachOptions) error { func runAttach(dockerCli command.Cli, opts *attachOptions) error {
ctx := context.Background() ctx := context.Background()
client := dockerCli.Client() apiClient := dockerCli.Client()
// request channel to wait for client // request channel to wait for client
resultC, errC := client.ContainerWait(ctx, opts.container, "") resultC, errC := apiClient.ContainerWait(ctx, opts.container, "")
c, err := inspectContainerAndCheckState(ctx, client, opts.container) c, err := inspectContainerAndCheckState(ctx, apiClient, opts.container)
if err != nil { if err != nil {
return err return err
} }
@ -109,7 +109,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
defer signal.StopCatch(sigc) defer signal.StopCatch(sigc)
} }
resp, errAttach := client.ContainerAttach(ctx, opts.container, options) resp, errAttach := apiClient.ContainerAttach(ctx, opts.container, options)
if errAttach != nil { if errAttach != nil {
return errAttach return errAttach
} }
@ -123,7 +123,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error {
// the container and not exit. // the container and not exit.
// //
// Recheck the container's state to avoid attach block. // Recheck the container's state to avoid attach block.
_, err = inspectContainerAndCheckState(ctx, client, opts.container) _, err = inspectContainerAndCheckState(ctx, apiClient, opts.container)
if err != nil { if err != nil {
return err return err
} }