Skip to content

Commit

Permalink
Upgrade docker dependency to address vulnerability (#5614)
Browse files Browse the repository at this point in the history
* Upgrade docker dependency to address vulnerability

Signed-off-by: Katrina Rogan <[email protected]>

* update

Signed-off-by: Katrina Rogan <[email protected]>

---------

Signed-off-by: Katrina Rogan <[email protected]>
  • Loading branch information
katrogan authored Aug 1, 2024
1 parent 025296a commit 01ecd0a
Show file tree
Hide file tree
Showing 17 changed files with 142 additions and 123 deletions.
5 changes: 3 additions & 2 deletions flytectl/cmd/demo/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
Expand All @@ -26,7 +27,7 @@ func TestDemoClusterExec(t *testing.T) {
cmdCtx := cmdCore.NewCommandContext(mockClient, *mockOutStream)
reader := bufio.NewReader(strings.NewReader("test"))

mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down Expand Up @@ -54,7 +55,7 @@ func TestSandboxClusterExecWithoutCmd(t *testing.T) {

ctx := s.Ctx

mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down
3 changes: 2 additions & 1 deletion flytectl/cmd/demo/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
"github.com/flyteorg/flyte/flytectl/pkg/docker/mocks"
Expand All @@ -33,7 +34,7 @@ var fakePod = corev1.Pod{
func sandboxSetup(ctx context.Context, legacy bool) {
mockDocker := &mocks.Docker{}
docker.Client = mockDocker
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down
5 changes: 3 additions & 2 deletions flytectl/cmd/demo/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
"github.com/flyteorg/flyte/flytectl/pkg/docker/mocks"
Expand All @@ -15,7 +16,7 @@ func TestDemoStatus(t *testing.T) {
mockDocker := &mocks.Docker{}
s := testutils.Setup()
defer s.TearDown()
mockDocker.OnContainerList(s.Ctx, types.ContainerListOptions{All: true}).Return([]types.Container{}, nil)
mockDocker.OnContainerList(s.Ctx, container.ListOptions{All: true}).Return([]types.Container{}, nil)
docker.Client = mockDocker
err := demoClusterStatus(s.Ctx, []string{}, s.CmdCtx)
assert.Nil(t, err)
Expand All @@ -25,7 +26,7 @@ func TestDemoStatus(t *testing.T) {
defer s.TearDown()
ctx := s.Ctx
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down
19 changes: 10 additions & 9 deletions flytectl/cmd/demo/teardown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
sandboxCmdConfig "github.com/flyteorg/flyte/flytectl/cmd/config/subcommand/sandbox"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/configutil"
Expand Down Expand Up @@ -33,8 +34,8 @@ func TestTearDownFunc(t *testing.T) {
t.Run("SuccessKeepVolume", func(t *testing.T) {
ctx := context.Background()
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, types.ContainerRemoveOptions{Force: true}).Return(nil)
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, container.RemoveOptions{Force: true}).Return(nil)
mockK8sContextMgr := &k8sMocks.ContextOps{}
k8s.ContextMgr = mockK8sContextMgr
mockK8sContextMgr.OnRemoveContextMatch(mock.Anything).Return(nil)
Expand All @@ -44,8 +45,8 @@ func TestTearDownFunc(t *testing.T) {
t.Run("SuccessRemoveVolume", func(t *testing.T) {
ctx := context.Background()
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, types.ContainerRemoveOptions{Force: true}).Return(nil)
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, container.RemoveOptions{Force: true}).Return(nil)
mockDocker.OnVolumeRemove(ctx, docker.FlyteSandboxVolumeName, true).Return(nil)
mockK8sContextMgr := &k8sMocks.ContextOps{}
k8s.ContextMgr = mockK8sContextMgr
Expand All @@ -60,16 +61,16 @@ func TestTearDownFunc(t *testing.T) {
t.Run("ErrorOnContainerRemove", func(t *testing.T) {
ctx := context.Background()
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, types.ContainerRemoveOptions{Force: true}).Return(fmt.Errorf("err"))
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, container.RemoveOptions{Force: true}).Return(fmt.Errorf("err"))
err := sandbox.Teardown(ctx, mockDocker, sandboxCmdConfig.DefaultTeardownFlags)
assert.NotNil(t, err)
})

t.Run("ErrorOnContainerList", func(t *testing.T) {
ctx := context.Background()
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(nil, fmt.Errorf("err"))
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(nil, fmt.Errorf("err"))
err := sandbox.Teardown(ctx, mockDocker, sandboxCmdConfig.DefaultTeardownFlags)
assert.NotNil(t, err)
})
Expand All @@ -84,8 +85,8 @@ func TestTearDownClusterFunc(t *testing.T) {

ctx := s.Ctx
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, types.ContainerRemoveOptions{Force: true}).Return(nil)
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, container.RemoveOptions{Force: true}).Return(nil)
docker.Client = mockDocker
err := teardownDemoCluster(ctx, []string{}, s.CmdCtx)
assert.Nil(t, err)
Expand Down
5 changes: 3 additions & 2 deletions flytectl/cmd/sandbox/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
cmdCore "github.com/flyteorg/flyte/flytectl/cmd/core"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
Expand All @@ -26,7 +27,7 @@ func TestSandboxClusterExec(t *testing.T) {
cmdCtx := cmdCore.NewCommandContext(mockClient, *mockOutStream)
reader := bufio.NewReader(strings.NewReader("test"))

mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand All @@ -52,7 +53,7 @@ func TestSandboxClusterExecWithoutCmd(t *testing.T) {
s := testutils.Setup()
ctx := s.Ctx

mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down
5 changes: 3 additions & 2 deletions flytectl/cmd/sandbox/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
"github.com/flyteorg/flyte/flytectl/pkg/docker/mocks"
Expand All @@ -14,7 +15,7 @@ func TestSandboxStatus(t *testing.T) {
t.Run("Sandbox status with zero result", func(t *testing.T) {
mockDocker := &mocks.Docker{}
s := testutils.Setup()
mockDocker.OnContainerList(s.Ctx, types.ContainerListOptions{All: true}).Return([]types.Container{}, nil)
mockDocker.OnContainerList(s.Ctx, container.ListOptions{All: true}).Return([]types.Container{}, nil)
docker.Client = mockDocker
err := sandboxClusterStatus(s.Ctx, []string{}, s.CmdCtx)
assert.Nil(t, err)
Expand All @@ -23,7 +24,7 @@ func TestSandboxStatus(t *testing.T) {
s := testutils.Setup()
ctx := s.Ctx
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return([]types.Container{
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return([]types.Container{
{
ID: docker.FlyteSandboxClusterName,
Names: []string{
Expand Down
5 changes: 3 additions & 2 deletions flytectl/cmd/sandbox/teardown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/flyteorg/flyte/flytectl/cmd/testutils"
"github.com/flyteorg/flyte/flytectl/pkg/configutil"
"github.com/flyteorg/flyte/flytectl/pkg/docker"
Expand All @@ -22,8 +23,8 @@ func TestTearDownClusterFunc(t *testing.T) {
s := testutils.Setup()
ctx := s.Ctx
mockDocker := &mocks.Docker{}
mockDocker.OnContainerList(ctx, types.ContainerListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, types.ContainerRemoveOptions{Force: true}).Return(nil)
mockDocker.OnContainerList(ctx, container.ListOptions{All: true}).Return(containers, nil)
mockDocker.OnContainerRemove(ctx, mock.Anything, container.RemoveOptions{Force: true}).Return(nil)
mockK8sContextMgr := &k8sMocks.ContextOps{}
mockK8sContextMgr.OnRemoveContext(mock.Anything).Return(nil)
k8s.ContextMgr = mockK8sContextMgr
Expand Down
6 changes: 4 additions & 2 deletions flytectl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.10.0
github.com/disiqueira/gotree v1.0.0
github.com/docker/docker v24.0.9+incompatible
github.com/docker/docker v26.1.5+incompatible
github.com/docker/go-connections v0.4.0
github.com/enescakir/emoji v1.0.0
github.com/flyteorg/flyte/flyteidl v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -71,11 +71,12 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/coocood/freecache v1.1.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/danieljoos/wincred v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
Expand Down Expand Up @@ -123,6 +124,7 @@ require (
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
Expand Down
12 changes: 8 additions & 4 deletions flytectl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/P
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
github.com/coocood/freecache v1.1.1 h1:uukNF7QKCZEdZ9gAV7WQzvh0SbjwdMF6m3x3rxEkaPc=
github.com/coocood/freecache v1.1.1/go.mod h1:OKrEjkGVoxZhyWAJoeFi5BMLUJm2Tit0kpGkIr7NGYY=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
Expand All @@ -120,10 +122,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/disiqueira/gotree v1.0.0 h1:en5wk87n7/Jyk6gVME3cx3xN9KmUCstJ1IjHr4Se4To=
github.com/disiqueira/gotree v1.0.0/go.mod h1:7CwL+VWsWAU95DovkdRZAtA7YbtHwGk+tLV/kNi8niU=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0=
github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v26.1.5+incompatible h1:NEAxTwEjxV6VbBMBoGG3zPqbiJosIApZjxlbrG9q3/g=
github.com/docker/docker v26.1.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
Expand Down Expand Up @@ -353,6 +355,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down
11 changes: 6 additions & 5 deletions flytectl/pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"
Expand All @@ -16,16 +17,16 @@ import (

type Docker interface {
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error
ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error)
ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error
ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)
ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error)
ContainerRemove(ctx context.Context, containerID string, options container.RemoveOptions) error
ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
ImageList(ctx context.Context, listOption types.ImageListOptions) ([]types.ImageSummary, error)
ImageList(ctx context.Context, listOption types.ImageListOptions) ([]image.Summary, error)
ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error)
CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)
VolumeCreate(ctx context.Context, options volume.CreateOptions) (volume.Volume, error)
Expand Down
10 changes: 5 additions & 5 deletions flytectl/pkg/docker/docker_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func GetDockerClient() (Docker, error) {

// GetSandbox will return sandbox container if it exist
func GetSandbox(ctx context.Context, cli Docker) (*types.Container, error) {
containers, err := cli.ContainerList(ctx, types.ContainerListOptions{
containers, err := cli.ContainerList(ctx, container.ListOptions{
All: true,
})
if err != nil {
Expand All @@ -97,7 +97,7 @@ func RemoveSandbox(ctx context.Context, cli Docker, reader io.Reader) error {

if c != nil {
if docker.DefaultConfig.Force || cmdUtil.AskForConfirmation("delete existing sandbox cluster", reader) {
err := cli.ContainerRemove(context.Background(), c.ID, types.ContainerRemoveOptions{
err := cli.ContainerRemove(context.Background(), c.ID, container.RemoveOptions{
Force: true,
})
return err
Expand Down Expand Up @@ -273,7 +273,7 @@ func StartContainer(ctx context.Context, cli Docker, volumes []mount.Mount, expo
return "", err
}

if err := cli.ContainerStart(context.Background(), resp.ID, types.ContainerStartOptions{}); err != nil {
if err := cli.ContainerStart(context.Background(), resp.ID, container.StartOptions{}); err != nil {
return "", err
}
return resp.ID, nil
Expand All @@ -287,7 +287,7 @@ func CopyContainerFile(ctx context.Context, cli Docker, source, destination, nam
}
var removeErr error
defer func() {
removeErr = cli.ContainerRemove(context.Background(), resp.ID, types.ContainerRemoveOptions{
removeErr = cli.ContainerRemove(context.Background(), resp.ID, container.RemoveOptions{
Force: true,
})
}()
Expand Down Expand Up @@ -320,7 +320,7 @@ func CopyContainerFile(ctx context.Context, cli Docker, source, destination, nam

// ReadLogs will return io scanner for reading the logs of a container
func ReadLogs(ctx context.Context, cli Docker, id string) (*bufio.Scanner, error) {
reader, err := cli.ContainerLogs(ctx, id, types.ContainerLogsOptions{
reader, err := cli.ContainerLogs(ctx, id, container.LogsOptions{
ShowStderr: true,
ShowStdout: true,
Timestamps: true,
Expand Down
Loading

0 comments on commit 01ecd0a

Please sign in to comment.