Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
segevfiner committed Aug 1, 2024
1 parent 82d476d commit 86a0f4c
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 66 deletions.
12 changes: 6 additions & 6 deletions dockerexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
specs "github.com/opencontainers/image-spec/specs-go/v1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

// Cmd represents a container being prepared or run.
Expand All @@ -36,7 +36,7 @@ type Cmd struct {
Config *container.Config
HostConfig *container.HostConfig
Networkingconfig *network.NetworkingConfig
Platform *specs.Platform
Platform *ocispec.Platform
ContainerName string

// Stdin specifies the container's standard input.
Expand Down Expand Up @@ -252,7 +252,7 @@ func (c *Cmd) Start() error {

c.Warnings = cont.Warnings

attach, err := c.cli.ContainerAttach(ctx, cont.ID, types.ContainerAttachOptions{
attach, err := c.cli.ContainerAttach(ctx, cont.ID, container.AttachOptions{
Stream: true,
Stdin: c.Stdin != nil,
Stdout: c.Stdout != nil,
Expand All @@ -262,7 +262,7 @@ func (c *Cmd) Start() error {
c.closeDescriptors(c.closeAfterStdin)
c.closeDescriptors(c.closeAfterOutput)
c.closeDescriptors(c.closeAfterWait)
_ = c.cli.ContainerRemove(context.Background(), cont.ID, types.ContainerRemoveOptions{
_ = c.cli.ContainerRemove(context.Background(), cont.ID, container.RemoveOptions{
RemoveVolumes: true,
Force: true,
})
Expand All @@ -280,12 +280,12 @@ func (c *Cmd) Start() error {

c.waitCh, c.waitErrCh = c.cli.ContainerWait(ctx, cont.ID, container.WaitConditionNextExit)

err = c.cli.ContainerStart(ctx, cont.ID, types.ContainerStartOptions{})
err = c.cli.ContainerStart(ctx, cont.ID, container.StartOptions{})
if err != nil {
c.closeDescriptors(c.closeAfterStdin)
c.closeDescriptors(c.closeAfterOutput)
c.closeDescriptors(c.closeAfterWait)
_ = c.cli.ContainerRemove(context.Background(), cont.ID, types.ContainerRemoveOptions{
_ = c.cli.ContainerRemove(context.Background(), cont.ID, container.RemoveOptions{
RemoveVolumes: true,
Force: true,
})
Expand Down
4 changes: 2 additions & 2 deletions dockerexec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/stretchr/testify/assert"
Expand All @@ -33,7 +33,7 @@ func TestMain(m *testing.M) {

if _, _, err := dockerClient.ImageInspectWithRaw(context.Background(), testImage); err != nil {
if client.IsErrNotFound(err) {
pullOutput, err := dockerClient.ImagePull(context.Background(), testImage, types.ImagePullOptions{})
pullOutput, err := dockerClient.ImagePull(context.Background(), testImage, image.PullOptions{})
if err != nil {
panic(err)
}
Expand Down
40 changes: 24 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
module github.com/segevfiner/dockerexec

go 1.19
go 1.21

require (
github.com/docker/docker v24.0.9+incompatible
github.com/opencontainers/image-spec v1.1.0-rc2
github.com/stretchr/testify v1.8.2
github.com/docker/docker v27.1.1+incompatible
github.com/opencontainers/image-spec v1.1.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/time v0.5.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.4.0 // indirect
gotest.tools/v3 v3.5.1 // indirect
)
Loading

0 comments on commit 86a0f4c

Please sign in to comment.