Skip to content

Commit

Permalink
Greening (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
visill authored Sep 10, 2024
1 parent ee97a26 commit 3313a65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/feature/testutil/docker_composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (dc *DockerComposer) RunCommand(service string, cmd string, timeout time.Du
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
execCfg := types.ExecConfig{
execCfg := container.ExecOptions{
AttachStdout: true,
AttachStderr: true,
Cmd: []string{shell, "-c", cmd},
Expand All @@ -220,7 +220,7 @@ func (dc *DockerComposer) RunCommand(service string, cmd string, timeout time.Du
if err != nil {
return 0, "", err
}
attachResp, err := dc.api.ContainerExecAttach(ctx, execResp.ID, types.ExecStartCheck{})
attachResp, err := dc.api.ContainerExecAttach(ctx, execResp.ID, container.ExecStartOptions{})
if err != nil {
return 0, "", err
}
Expand All @@ -234,7 +234,7 @@ func (dc *DockerComposer) RunCommand(service string, cmd string, timeout time.Du
if err != nil {
return 0, "", err
}
var insp types.ContainerExecInspect
var insp container.ExecInspect
Retry(func() bool {
insp, err = dc.api.ContainerExecInspect(ctx, execResp.ID)
return err != nil || !insp.Running
Expand All @@ -254,15 +254,15 @@ func (dc *DockerComposer) RunAsyncCommand(service string, cmd string) error {
if !ok {
return fmt.Errorf("no such service: %s", service)
}
execCfg := types.ExecConfig{
execCfg := container.ExecOptions{
Detach: true,
Cmd: []string{shell, "-c", cmd},
}
execResp, err := dc.api.ContainerExecCreate(context.Background(), cont.ID, execCfg)
if err != nil {
return err
}
return dc.api.ContainerExecStart(context.Background(), execResp.ID, types.ExecStartCheck{})
return dc.api.ContainerExecStart(context.Background(), execResp.ID, container.ExecStartOptions{})
}

// GetFile returns content of the fail from continer by path
Expand Down

0 comments on commit 3313a65

Please sign in to comment.