Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

(MAINT) Update ContainerExecAttach signature

This commit fixes the ContainerExecAttach to use `ExecStartCheck` rather
than `ExecConfig` following the upstream fix in the Docker API.

see moby/moby#35128
  • Loading branch information...
johnmccabe committed Oct 19, 2017
1 parent 931fd72 commit 833130048ffc130a3a082d8a55cb3b452d594491
Showing with 5 additions and 9 deletions.
  1. +1 −1 capabilities/ospackages/package.go
  2. +4 −8 dockeradapter/dockeradapter.go
@@ -22,7 +22,7 @@ func runPackageCmd(client dockeradapter.Harvester, containerID string, cmd []str
}
logging.Debug("[Package] Container Exec Created, ID: %s", execInstance.ID)

att, err := client.ContainerExecAttach(ctx, execInstance.ID, cmd, attachStdout, attachStderr)
att, err := client.ContainerExecAttach(ctx, execInstance.ID)
if err != nil {
err = fmt.Errorf("[Package] Unable to attach exec: %s", err)
logging.Debug(err.Error())
@@ -66,7 +66,7 @@ type Inspector interface {
type Executor interface {
ContainerExecCreate(ctx context.Context, execID string, cmd []string, attachStdout bool, attachStderr bool) (dockertypes.IDResponse, error)
ContainerExecStart(ctx context.Context, execID string) error
ContainerExecAttach(ctx context.Context, execID string, cmd []string, attachStdout bool, attachStderr bool) (dockertypes.HijackedResponse, error)
ContainerExecAttach(ctx context.Context, execID string) (dockertypes.HijackedResponse, error)
ContainerExecInspect(ctx context.Context, execID string) (dockertypes.ContainerExecInspect, error)
}

@@ -273,13 +273,9 @@ func (c *concreteDockerClient) ContainerExecStart(ctx context.Context, execID st
return c.Client.ContainerExecStart(ctx, execID, execStartOpts)
}

func (c *concreteDockerClient) ContainerExecAttach(ctx context.Context, execID string, cmd []string, attachStdout bool, attachStderr bool) (dockertypes.HijackedResponse, error) {
execOpts := dockertypes.ExecConfig{
Cmd: cmd,
AttachStdout: attachStdout,
AttachStderr: attachStderr,
}
return c.Client.ContainerExecAttach(ctx, execID, execOpts)
func (c *concreteDockerClient) ContainerExecAttach(ctx context.Context, execID string) (dockertypes.HijackedResponse, error) {
execStartOpts := dockertypes.ExecStartCheck{}
return c.Client.ContainerExecAttach(ctx, execID, execStartOpts)
}

func (c *concreteDockerClient) ContainerExecInspect(ctx context.Context, execID string) (dockertypes.ContainerExecInspect, error) {

0 comments on commit 8331300

Please sign in to comment.
You can’t perform that action at this time.