Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Removed usage of deprecated docker container type options #1032

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (d *docker) startContainer(ctx context.Context, image string, ports NamedPo

sidecarChan := d.setupContainerCleanup(resp.ID, cfg)

err = d.client.ContainerStart(ctx, resp.ID, types.ContainerStartOptions{})
err = d.client.ContainerStart(ctx, resp.ID, container.StartOptions{})
if err != nil {
return nil, fmt.Errorf("can't start container %s: %w", resp.ID, err)
}
Expand Down Expand Up @@ -348,7 +348,7 @@ func (d *docker) createContainer(
if len(matches) == 2 {
d.log.Infow("duplicate container found, stopping", "container", matches[1])

err = d.client.ContainerRemove(ctx, matches[1], types.ContainerRemoveOptions{
err = d.client.ContainerRemove(ctx, matches[1], container.RemoveOptions{
Force: true,
})
if err != nil {
Expand All @@ -371,7 +371,7 @@ func (d *docker) findReusableContainer(
return nil, false, fmt.Errorf("container name is required when container reuse is enabled")
}

list, err := d.client.ContainerList(ctx, types.ContainerListOptions{
list, err := d.client.ContainerList(ctx, container.ListOptions{
Filters: filters.NewArgs(
filters.Arg("name", cfg.ContainerName),
filters.Arg("ancestor", image),
Expand Down Expand Up @@ -422,7 +422,7 @@ func (d *docker) boundNamedPorts(json types.ContainerJSON, namedPorts NamedPorts
func (d *docker) readLogs(ctx context.Context, id string) (io.ReadCloser, error) {
d.log.Info("starting container logs forwarder")

logsOptions := types.ContainerLogsOptions{
logsOptions := container.LogsOptions{
ShowStderr: true, ShowStdout: true, Follow: true,
}

Expand Down Expand Up @@ -456,7 +456,7 @@ func (d *docker) removeContainer(ctx context.Context, id string) error {
d.lock.Lock()
defer d.lock.Unlock()

err := d.client.ContainerRemove(ctx, id, types.ContainerRemoveOptions{Force: true})
err := d.client.ContainerRemove(ctx, id, container.RemoveOptions{Force: true})
if err != nil && !client.IsErrNotFound(err) && !isDeletionAlreadyInProgessError(err, id) {
return fmt.Errorf("can't remove container %s: %w", id, err)
}
Expand Down
32 changes: 21 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/aws/aws-sdk-go v1.44.332
github.com/bradfitz/gomemcache v0.0.0-20230611145640-acc696258285
github.com/denisenkom/go-mssqldb v0.12.3
github.com/docker/docker v24.0.5+incompatible
github.com/docker/docker v26.1.0+incompatible
github.com/docker/go-connections v0.4.0
github.com/elastic/go-elasticsearch/v7 v7.17.10
github.com/elastic/go-elasticsearch/v8 v8.9.0
Expand All @@ -27,7 +27,7 @@ require (
github.com/morikuni/aec v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/segmentio/kafka-go v0.4.42
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
go.mongodb.org/mongo-driver v1.12.1
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.25.0
Expand All @@ -46,14 +46,17 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deepmap/oapi-codegen v1.10.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/elastic/elastic-transport-go/v8 v8.2.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -62,7 +65,7 @@ require (
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -82,6 +85,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // 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/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
Expand All @@ -97,15 +101,21 @@ require (
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/net v0.13.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.50.0 // indirect
go.opentelemetry.io/otel v1.25.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.25.0 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.25.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading