Replace command.DockerCli to command.Cli in docker attach/exec command

Signed-off-by: Shukui Yang <yangshukui@huawei.com>
This commit is contained in:
Shukui Yang
2017-06-08 07:03:52 +08:00
parent 6c59636498
commit e8cc2cf760
7 changed files with 123 additions and 7 deletions

View File

@ -34,11 +34,12 @@ func inspectContainerAndCheckState(ctx context.Context, cli client.APIClient, ar
if c.State.Paused {
return nil, errors.New("You cannot attach to a paused container, unpause it first")
}
return &c, nil
}
// NewAttachCommand creates a new cobra.Command for `docker attach`
func NewAttachCommand(dockerCli *command.DockerCli) *cobra.Command {
func NewAttachCommand(dockerCli command.Cli) *cobra.Command {
var opts attachOptions
cmd := &cobra.Command{
@ -58,7 +59,7 @@ func NewAttachCommand(dockerCli *command.DockerCli) *cobra.Command {
return cmd
}
func runAttach(dockerCli *command.DockerCli, opts *attachOptions) error {
func runAttach(dockerCli command.Cli, opts *attachOptions) error {
ctx := context.Background()
client := dockerCli.Client()