Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bump github.com/docker/cli from 24.0.9+incompatible to 26.1.0+incompatible #411

Merged
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
7 changes: 4 additions & 3 deletions cmd/backup/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/cosiner/argv"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/pkg/stdcopy"
"github.com/offen/docker-volume-backup/internal/errwrap"
Expand Down Expand Up @@ -96,7 +97,7 @@ func (s *script) runLabeledCommands(label string) error {
Value: fmt.Sprintf("docker-volume-backup.exec-label=%s", s.c.ExecLabel),
})
}
containersWithCommand, err := s.cli.ContainerList(context.Background(), types.ContainerListOptions{
containersWithCommand, err := s.cli.ContainerList(context.Background(), container.ListOptions{
Filters: filters.NewArgs(f...),
})
if err != nil {
Expand All @@ -109,7 +110,7 @@ func (s *script) runLabeledCommands(label string) error {
Key: "label",
Value: "docker-volume-backup.exec-pre",
}
deprecatedContainers, err := s.cli.ContainerList(context.Background(), types.ContainerListOptions{
deprecatedContainers, err := s.cli.ContainerList(context.Background(), container.ListOptions{
Filters: filters.NewArgs(f...),
})
if err != nil {
Expand All @@ -126,7 +127,7 @@ func (s *script) runLabeledCommands(label string) error {
Key: "label",
Value: "docker-volume-backup.exec-post",
}
deprecatedContainers, err := s.cli.ContainerList(context.Background(), types.ContainerListOptions{
deprecatedContainers, err := s.cli.ContainerList(context.Background(), container.ListOptions{
Filters: filters.NewArgs(f...),
})
if err != nil {
Expand Down
12 changes: 7 additions & 5 deletions cmd/backup/stop_restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import (

"github.com/docker/cli/cli/command/service/progress"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
ctr "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/api/types/system"
"github.com/docker/docker/client"
"github.com/offen/docker-volume-backup/internal/errwrap"
)
Expand Down Expand Up @@ -65,7 +67,7 @@ func awaitContainerCountForService(cli *client.Client, serviceID string, count i
),
)
case <-poll.C:
containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{
containers, err := cli.ContainerList(context.Background(), container.ListOptions{
Filters: filters.NewArgs(filters.KeyValuePair{
Key: "label",
Value: fmt.Sprintf("com.docker.swarm.service.id=%s", serviceID),
Expand All @@ -82,7 +84,7 @@ func awaitContainerCountForService(cli *client.Client, serviceID string, count i
}

func isSwarm(c interface {
Info(context.Context) (types.Info, error)
Info(context.Context) (system.Info, error)
}) (bool, error) {
info, err := c.Info(context.Background())
if err != nil {
Expand Down Expand Up @@ -123,11 +125,11 @@ func (s *script) stopContainersAndServices() (func() error, error) {
labelValue,
)

allContainers, err := s.cli.ContainerList(context.Background(), types.ContainerListOptions{})
allContainers, err := s.cli.ContainerList(context.Background(), container.ListOptions{})
if err != nil {
return noop, errwrap.Wrap(err, "error querying for containers")
}
containersToStop, err := s.cli.ContainerList(context.Background(), types.ContainerListOptions{
containersToStop, err := s.cli.ContainerList(context.Background(), container.ListOptions{
Filters: filters.NewArgs(filters.KeyValuePair{
Key: "label",
Value: filterMatchLabel,
Expand Down Expand Up @@ -309,7 +311,7 @@ func (s *script) stopContainersAndServices() (func() error, error) {
continue
}

if err := s.cli.ContainerStart(context.Background(), container.ID, types.ContainerStartOptions{}); err != nil {
if err := s.cli.ContainerStart(context.Background(), container.ID, ctr.StartOptions{}); err != nil {
restartErrors = append(restartErrors, err)
}
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/backup/stop_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import (
"errors"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/api/types/system"
)

type mockInfoClient struct {
result types.Info
result system.Info
err error
}

func (m *mockInfoClient) Info(context.Context) (types.Info, error) {
func (m *mockInfoClient) Info(context.Context) (system.Info, error) {
return m.result, m.err
}

Expand All @@ -28,7 +28,7 @@ func TestIsSwarm(t *testing.T) {
{
"swarm",
&mockInfoClient{
result: types.Info{
result: system.Info{
Swarm: swarm.Info{
LocalNodeState: swarm.LocalNodeStateActive,
},
Expand All @@ -40,7 +40,7 @@ func TestIsSwarm(t *testing.T) {
{
"compose",
&mockInfoClient{
result: types.Info{
result: system.Info{
Swarm: swarm.Info{
LocalNodeState: swarm.LocalNodeStateInactive,
},
Expand All @@ -52,7 +52,7 @@ func TestIsSwarm(t *testing.T) {
{
"balena",
&mockInfoClient{
result: types.Info{
result: system.Info{
Swarm: swarm.Info{
LocalNodeState: "",
},
Expand Down
28 changes: 20 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
github.com/containrrr/shoutrrr v0.7.1
github.com/cosiner/argv v0.1.0
github.com/docker/cli v24.0.9+incompatible
github.com/docker/docker v24.0.7+incompatible
github.com/docker/cli v26.1.0+incompatible
github.com/docker/docker v26.1.0+incompatible
github.com/gofrs/flock v0.8.1
github.com/joho/godotenv v1.5.1
github.com/klauspost/compress v1.17.8
Expand All @@ -19,7 +19,7 @@ require (
github.com/pkg/sftp v1.13.6
github.com/robfig/cron/v3 v3.0.1
github.com/studio-b12/gowebdav v0.9.0
golang.org/x/crypto v0.21.0
golang.org/x/crypto v0.22.0
golang.org/x/oauth2 v0.19.0
golang.org/x/sync v0.7.0
mvdan.cc/sh/v3 v3.8.0
Expand All @@ -28,10 +28,23 @@ require (
require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/distribution/reference v0.6.0 // 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/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/moby/docker-image-spec v1.3.1 // 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/time v0.0.0-20220609170525-579cf78fd858 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
)

require (
Expand All @@ -40,7 +53,6 @@ require (
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.1
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5
Expand Down Expand Up @@ -68,8 +80,8 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading
Loading