mirror of https://github.com/docker/cli.git
cli/command/container: attach: rename var that collided with import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1db37a881a
commit
0c5adb2e98
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue