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

chore(deps): bump github.com/docker/cli from 26.1.5+incompatible to 27.2.1+incompatible #2667

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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ require (
github.com/containers/common v0.59.2
github.com/danieljoos/wincred v1.2.1
github.com/deepmap/oapi-codegen/v2 v2.2.0
github.com/docker/cli v26.1.5+incompatible
github.com/docker/docker v26.1.5+incompatible
github.com/docker/cli v27.2.1+incompatible
github.com/docker/docker v27.2.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/docker/go-units v0.5.0
github.com/getsentry/sentry-go v0.28.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,13 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
github.com/docker/cli v26.1.5+incompatible h1:NxXGSdz2N+Ibdaw330TDO3d/6/f7MvHuiMbuFaIQDTk=
github.com/docker/cli v26.1.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/cli v27.2.1+incompatible h1:U5BPtiD0viUzjGAjV1p0MGB8eVA3L3cbIrnyWmSJI70=
github.com/docker/cli v27.2.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
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/docker v27.2.1+incompatible h1:fQdiLfW7VLscyoeYEBz7/J8soYFDZV1u6VW6gJEjNMI=
github.com/docker/docker v27.2.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
Expand Down
6 changes: 3 additions & 3 deletions internal/db/branch/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"path/filepath"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/stdcopy"
"github.com/go-errors/errors"
"github.com/spf13/afero"
Expand Down Expand Up @@ -70,7 +70,7 @@ func assertNewBranchIsValid(branchPath string, fsys afero.Fs) error {
}

func createBranch(ctx context.Context, branch string) error {
exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, types.ExecConfig{
exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, container.ExecOptions{
Cmd: []string{"/bin/bash", "-c", cloneScript},
Env: []string{"DB_NAME=" + branch},
AttachStderr: true,
Expand All @@ -80,7 +80,7 @@ func createBranch(ctx context.Context, branch string) error {
return err
}
// Read exec output
resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/db/branch/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"path/filepath"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/pkg/stdcopy"
"github.com/go-errors/errors"
"github.com/spf13/afero"
Expand Down Expand Up @@ -58,7 +58,7 @@ func deleteBranchDir(branch string, fsys afero.Fs) error {
}

func deleteBranchPG(ctx context.Context, branch string) error {
exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, types.ExecConfig{
exec, err := utils.Docker.ContainerExecCreate(ctx, utils.DbId, container.ExecOptions{
Cmd: []string{"dropdb", "--username", "postgres", "--host", "127.0.0.1", branch},
AttachStderr: true,
AttachStdout: true,
Expand All @@ -67,7 +67,7 @@ func deleteBranchPG(ctx context.Context, branch string) error {
return err
}
// Read exec output
resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
resp, err := utils.Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
if err != nil {
return err
}
Expand Down
5 changes: 3 additions & 2 deletions internal/start/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/volume"
"github.com/h2non/gock"
"github.com/jackc/pgconn"
Expand Down Expand Up @@ -85,7 +86,7 @@ func TestDatabaseStart(t *testing.T) {
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/networks/create").
Reply(http.StatusCreated).
JSON(types.NetworkCreateResponse{})
JSON(network.CreateResponse{})
// Caches all dependencies
imageUrl := utils.GetRegistryImageUrl(utils.Config.Db.Image)
gock.New(utils.Docker.DaemonHost()).
Expand Down Expand Up @@ -201,7 +202,7 @@ func TestDatabaseStart(t *testing.T) {
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/networks/create").
Reply(http.StatusCreated).
JSON(types.NetworkCreateResponse{})
JSON(network.CreateResponse{})
// Caches all dependencies
imageUrl := utils.GetRegistryImageUrl(utils.Config.Db.Image)
gock.New(utils.Docker.DaemonHost()).
Expand Down
10 changes: 6 additions & 4 deletions internal/stop/stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/volume"
"github.com/h2non/gock"
"github.com/spf13/afero"
Expand All @@ -33,11 +35,11 @@ func TestStopCommand(t *testing.T) {
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/containers/prune").
Reply(http.StatusOK).
JSON(types.ContainersPruneReport{})
JSON(container.PruneReport{})
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/networks/prune").
Reply(http.StatusOK).
JSON(types.NetworksPruneReport{})
JSON(network.PruneReport{})
gock.New(utils.Docker.DaemonHost()).
Get("/v" + utils.Docker.ClientVersion() + "/volumes").
Reply(http.StatusOK).
Expand Down Expand Up @@ -94,11 +96,11 @@ func TestStopServices(t *testing.T) {
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/containers/prune").
Reply(http.StatusOK).
JSON(types.ContainersPruneReport{})
JSON(container.PruneReport{})
gock.New(utils.Docker.DaemonHost()).
Post("/v" + utils.Docker.ClientVersion() + "/networks/prune").
Reply(http.StatusOK).
JSON(types.NetworksPruneReport{})
JSON(network.PruneReport{})
// Run test
err := stop(context.Background(), true, io.Discard)
// Check error
Expand Down
9 changes: 5 additions & 4 deletions internal/testing/apitest/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/docker/docker/api"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/volume"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
Expand Down Expand Up @@ -38,7 +39,7 @@ func MockDockerStart(docker *client.Client, image, containerID string) {
gock.New(docker.DaemonHost()).
Post("/v" + docker.ClientVersion() + "/networks/create").
Reply(http.StatusCreated).
JSON(types.NetworkCreateResponse{})
JSON(network.CreateResponse{})
gock.New(docker.DaemonHost()).
Post("/v" + docker.ClientVersion() + "/volumes/create").
Persist().
Expand All @@ -62,15 +63,15 @@ func MockDockerStop(docker *client.Client) {
gock.New(docker.DaemonHost()).
Post("/v" + docker.ClientVersion() + "/containers/prune").
Reply(http.StatusOK).
JSON(types.ContainersPruneReport{})
JSON(container.PruneReport{})
gock.New(docker.DaemonHost()).
Post("/v" + docker.ClientVersion() + "/volumes/prune").
Reply(http.StatusOK).
JSON(types.VolumesPruneReport{})
JSON(volume.PruneReport{})
gock.New(docker.DaemonHost()).
Post("/v" + docker.ClientVersion() + "/networks/prune").
Reply(http.StatusOK).
JSON(types.NetworksPruneReport{})
JSON(network.PruneReport{})
}

// Ref: internal/utils/docker.go::DockerRunOnce
Expand Down
16 changes: 6 additions & 10 deletions internal/utils/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
dockerConfig "github.com/docker/cli/cli/config"
dockerFlags "github.com/docker/cli/cli/flags"
"github.com/docker/cli/cli/streams"
"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/image"
Expand Down Expand Up @@ -65,10 +64,7 @@ func DockerNetworkCreateIfNotExists(ctx context.Context, mode container.NetworkM
if !isUserDefined(mode) {
return nil
}
_, err := Docker.NetworkCreate(ctx, mode.NetworkName(), types.NetworkCreate{
CheckDuplicate: true,
Labels: labels,
})
_, err := Docker.NetworkCreate(ctx, mode.NetworkName(), network.CreateOptions{Labels: labels})
// if error is network already exists, no need to propagate to user
if errdefs.IsConflict(err) || errors.Is(err, podman.ErrNetworkExists) {
return nil
Expand Down Expand Up @@ -410,19 +406,19 @@ func DockerStreamLogsOnce(ctx context.Context, containerId string, stdout, stder
}

// Exec a command once inside a container, returning stdout and throwing error on non-zero exit code.
func DockerExecOnce(ctx context.Context, container string, env []string, cmd []string) (string, error) {
func DockerExecOnce(ctx context.Context, containerId string, env []string, cmd []string) (string, error) {
stderr := io.Discard
if viper.GetBool("DEBUG") {
stderr = os.Stderr
}
var out bytes.Buffer
err := DockerExecOnceWithStream(ctx, container, "", env, cmd, &out, stderr)
err := DockerExecOnceWithStream(ctx, containerId, "", env, cmd, &out, stderr)
return out.String(), err
}

func DockerExecOnceWithStream(ctx context.Context, container, workdir string, env, cmd []string, stdout, stderr io.Writer) error {
func DockerExecOnceWithStream(ctx context.Context, containerId, workdir string, env, cmd []string, stdout, stderr io.Writer) error {
// Reset shadow database
exec, err := Docker.ContainerExecCreate(ctx, container, types.ExecConfig{
exec, err := Docker.ContainerExecCreate(ctx, containerId, container.ExecOptions{
Env: env,
Cmd: cmd,
WorkingDir: workdir,
Expand All @@ -433,7 +429,7 @@ func DockerExecOnceWithStream(ctx context.Context, container, workdir string, en
return errors.Errorf("failed to exec docker create: %w", err)
}
// Read exec output
resp, err := Docker.ContainerExecAttach(ctx, exec.ID, types.ExecStartCheck{})
resp, err := Docker.ContainerExecAttach(ctx, exec.ID, container.ExecStartOptions{})
if err != nil {
return errors.Errorf("failed to exec docker attach: %w", err)
}
Expand Down
5 changes: 3 additions & 2 deletions internal/utils/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/stdcopy"
"github.com/h2non/gock"
Expand Down Expand Up @@ -133,7 +134,7 @@ func TestRunOnce(t *testing.T) {
gock.New(Docker.DaemonHost()).
Post("/v" + Docker.ClientVersion() + "/networks/create").
Reply(http.StatusCreated).
JSON(types.NetworkCreateResponse{})
JSON(network.CreateResponse{})
gock.New(Docker.DaemonHost()).
Post("/v" + Docker.ClientVersion() + "/containers/create").
Reply(http.StatusServiceUnavailable)
Expand All @@ -155,7 +156,7 @@ func TestRunOnce(t *testing.T) {
gock.New(Docker.DaemonHost()).
Post("/v" + Docker.ClientVersion() + "/networks/create").
Reply(http.StatusCreated).
JSON(types.NetworkCreateResponse{})
JSON(network.CreateResponse{})
gock.New(Docker.DaemonHost()).
Post("/v" + Docker.ClientVersion() + "/containers/create").
Reply(http.StatusOK).
Expand Down
6 changes: 3 additions & 3 deletions test/branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"os"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/stretchr/testify/require"
)

Expand All @@ -31,8 +31,8 @@ func (suite *DBTestSuite) TestBranchCreate() {

// check commands in exec calls
require.Equal(suite.T(), 2, len(suite.bodies))
var execBody types.ExecConfig
var execBody container.ExecOptions
require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[0]), &execBody))
var startBody types.ExecStartCheck
var startBody container.ExecStartOptions
require.NoError(suite.T(), json.Unmarshal([]byte(suite.bodies[1]), &startBody))
}