Skip to content

Commit

Permalink
Update docker to v26.1.2+incompatible
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletHynes committed May 10, 2024
1 parent 90fcdf1 commit ca33a7c
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 45 deletions.
4 changes: 2 additions & 2 deletions plugincontainer/container_runner_external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"strings"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-plugin"
Expand All @@ -42,7 +42,7 @@ func TestExamplePlugin(t *testing.T) {
}

// Get the full sha256 of the image we just built so we can test pinning.
images, err := dockerClient.ImageList(context.Background(), types.ImageListOptions{
images, err := dockerClient.ImageList(context.Background(), image.ListOptions{
Filters: filters.NewArgs(filters.Arg("reference", "go-plugin-counter:latest")),
})
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions plugincontainer/container_runner_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"context"
"errors"
"fmt"
"github.com/docker/docker/api/types/image"
"io"
"os"
"os/exec"
"path"
"strconv"
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/mount"
Expand Down Expand Up @@ -177,7 +177,7 @@ func (c *containerRunner) Start(ctx context.Context) error {
ref += ":" + c.tag
}
// Check the Image and SHA256 provided in the config match up.
images, err := c.dockerClient.ImageList(ctx, types.ImageListOptions{
images, err := c.dockerClient.ImageList(ctx, image.ListOptions{
Filters: filters.NewArgs(filters.Arg("reference", ref)),
})
if err != nil {
Expand All @@ -202,14 +202,14 @@ func (c *containerRunner) Start(ctx context.Context) error {
c.id = resp.ID
c.logger.Trace("created container", "image", c.image, "id", c.id)

if err := c.dockerClient.ContainerStart(ctx, c.id, types.ContainerStartOptions{}); err != nil {
if err := c.dockerClient.ContainerStart(ctx, c.id, container.StartOptions{}); err != nil {
return fmt.Errorf("error starting container: %w", err)
}

// ContainerLogs combines stdout and stderr.
// Container logs will stream beyond the lifetime of the initial start
// context, so we pass it a fresh context with no timeout.
logReader, err := c.dockerClient.ContainerLogs(context.Background(), c.id, types.ContainerLogsOptions{
logReader, err := c.dockerClient.ContainerLogs(context.Background(), c.id, container.LogsOptions{
Follow: true,
ShowStdout: true,
ShowStderr: true,
Expand Down Expand Up @@ -266,7 +266,7 @@ func (c *containerRunner) Kill(ctx context.Context) error {
if c.id != "" {
if c.debug {
defer func() {
err := c.dockerClient.ContainerRemove(ctx, c.id, types.ContainerRemoveOptions{
err := c.dockerClient.ContainerRemove(ctx, c.id, container.RemoveOptions{
Force: true,
})
if err != nil {
Expand Down Expand Up @@ -401,7 +401,7 @@ Check stdout in the logs below.
}

func (c *containerRunner) diagnoseLogs(ctx context.Context) string {
logReader, err := c.dockerClient.ContainerLogs(ctx, c.id, types.ContainerLogsOptions{
logReader, err := c.dockerClient.ContainerLogs(ctx, c.id, container.LogsOptions{
ShowStdout: true,
ShowStderr: true,
Follow: false,
Expand Down
34 changes: 23 additions & 11 deletions plugincontainer/go.mod
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
module github.com/hashicorp/go-secure-stdlib/plugincontainer

go 1.20
go 1.21

toolchain go1.22.1

require (
github.com/docker/docker v24.0.7+incompatible
github.com/docker/docker v26.1.2+incompatible
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-plugin v1.6.0
github.com/joshlf/go-acl v0.0.0-20200411065538-eae00ae38531
golang.org/x/sys v0.13.0
google.golang.org/grpc v1.57.1
google.golang.org/protobuf v1.31.0
golang.org/x/sys v0.19.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/joshlf/testutil v0.0.0-20170608050642-b5d8aa79d93d // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // 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/oklog/run v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/stretchr/testify v1.8.3 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
gotest.tools/v3 v3.5.0 // indirect
)

0 comments on commit ca33a7c

Please sign in to comment.