@@ -9,16 +9,18 @@ import (
99 "encoding/json"
1010 "errors"
1111 "fmt"
12- dockertypes "github.com/docker/docker/api/types"
13- dockercontainer "github.com/docker/docker/api/types/container"
14- dockernetwork "github.com/docker/docker/api/types/network"
15- dockerclient "github.com/docker/docker/client"
16- "github.com/hashicorp/go-multierror"
1712 "io"
1813 "math/rand/v2"
1914 "strconv"
2015 "strings"
2116 "testing"
17+
18+ dockertypes "github.com/docker/docker/api/types"
19+ dockercontainer "github.com/docker/docker/api/types/container"
20+ dockerimage "github.com/docker/docker/api/types/image"
21+ dockernetwork "github.com/docker/docker/api/types/network"
22+ dockerclient "github.com/docker/docker/client"
23+ "github.com/hashicorp/go-multierror"
2224)
2325
2426func NewDockerContainer (t testing.TB , image string , env []string , cmd []string ) (* DockerContainer , error ) {
@@ -72,7 +74,7 @@ func (d *DockerContainer) PullImage() (err error) {
7274 return errors .New ("Cannot pull image on a nil *DockerContainer" )
7375 }
7476 d .t .Logf ("Docker: Pull image %v" , d .ImageName )
75- r , err := d .client .ImagePull (context .Background (), d .ImageName , dockertypes. ImagePullOptions {})
77+ r , err := d .client .ImagePull (context .Background (), d .ImageName , dockerimage. PullOptions {})
7678 if err != nil {
7779 return err
7880 }
@@ -125,7 +127,7 @@ func (d *DockerContainer) Start() error {
125127 d .ContainerName = containerName
126128
127129 // then start it
128- if err := d .client .ContainerStart (context .Background (), resp .ID , dockertypes. ContainerStartOptions {}); err != nil {
130+ if err := d .client .ContainerStart (context .Background (), resp .ID , dockercontainer. StartOptions {}); err != nil {
129131 return err
130132 }
131133
@@ -157,7 +159,7 @@ func (d *DockerContainer) Remove() error {
157159 return errors .New ("missing containerId" )
158160 }
159161 if err := d .client .ContainerRemove (context .Background (), d .ContainerId ,
160- dockertypes. ContainerRemoveOptions {
162+ dockercontainer. RemoveOptions {
161163 Force : true ,
162164 }); err != nil {
163165 d .t .Log (err )
@@ -193,7 +195,7 @@ func (d *DockerContainer) Logs() (io.ReadCloser, error) {
193195 return nil , errors .New ("missing containerId" )
194196 }
195197
196- return d .client .ContainerLogs (context .Background (), d .ContainerId , dockertypes. ContainerLogsOptions {
198+ return d .client .ContainerLogs (context .Background (), d .ContainerId , dockercontainer. LogsOptions {
197199 ShowStdout : true ,
198200 ShowStderr : true ,
199201 })
0 commit comments